15장 - var 키워드 와 let, const 키워드의 다른점에 대해 호이스팅과 스코프의 측면에서 설명해 말해보세요.
...진행 예정
16장 - 데이터 프로퍼티와 접근자 프로퍼티를 섞어서 정의하면 어떻게 될까??
궁금하닥 궁금해.
그래서 직접 쳐본 코드 →
const person = {};
Object.defineProperty(person, 'experiment',{
value: '해보자구!!',
writable: true,
get(){
return this.experiment;
},
enumerable: true,
configurable: true
});
🥪 **똑똑한 자바스크립트 엔진. 에러가 뜬다.**
Uncaught TypeError: Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #
at Function.defineProperty ()
at :1:8
(anonymous) @ VM466:1