
Getter 와 Setter Getter 와 Setter 은 자체적으로 값을 갖고 있지 않고, 객체의 프로퍼티를 읽거나 조작할 때 사용하는 접근자 함수이다. Getter 는 메서드 이름 앞에 get 키워드를 사용해 정의하고, Setter 는 메서드 이름 앞에 set 키워드를 사용해 정의한다. const person = { firstName : 'Asher', lastName : 'Park', // getter get fullName() { return `${this.firstName} ${this.lastName}`; } // setter set fullName(name) { [this.firstName, this.lastName] = name.split(' '); } }; console.log(pers..