30. ES6의 향상된 객체 문법 알아보기 #53
Unanswered
Irisation23
asked this question in
JavaScript 200문제로 격파!!
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
ES6의 향상된 객체 문법 알아보기
단축 속성명
ES6에 새로 추가된 JavaScript 기능중 하나인
단축 속성명
은 객체의 속성(property)을 좀 더 간단하게 정의 할 수 있도록 했다.객체 속성을 리터럴로 정의하기 위해서는
키: 값
으로 작성했어야 했다.단축속성명은 변수가 미리 준비되어 있는 경우 활용 가능하며,
변수명
으로 속성의 키와 값을 한번에 정의할 수 있다.속성 계산명
속성 계산명(Coumputed Property Name)
속성 이름을 정의하는 다른 방법이다.대괄호 [] 안에 식을 넣거나 변수를 대입하여 동적으로 객체 속성들을 생성할 수 있다.
Beta Was this translation helpful? Give feedback.
All reactions