Notice
Recent Posts
Recent Comments
Link
개발일지
Enhanced Object Literals 본문
- 객체의 속성을 메서드로 사용할 때 function 예약어를 생략하고 생성 가능
var dic = {
words: 100,
// ES5
func: function(){
console.log("find");
},
// ES6
func() {
console.log("find");
}
};
- 객체의 속성명과 값 명이 동일할 때 아래와 같이 축약 가능
let figs = 10;
let dic = {
// figs : figs
figs
};
'HTML,CSS,JavaScript' 카테고리의 다른 글
JavaScript 이것저것 개념정리 (0) | 2020.03.12 |
---|---|
노드 개발 환경 설정 (0) | 2019.12.28 |
Modules (0) | 2019.10.27 |
Arrow Function (0) | 2019.10.27 |
const & let 변수, 스코프, 호이스팅 (0) | 2019.10.27 |
Comments