15-17장 스터디 정리

김동현 (마늘향기)·2023년 5월 12일
  • 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

profile
안녕하세요, 김동현입니다. 공부한 내용을 기록하고자 블로그를 생성하였습니다. 감사합니다.

0개의 댓글