답이 C. cat.fullName() 가 아님에 주의. 객체의 값을 받아오기 위해 함수 선언 없이 getter 로 사용할 수 있도록 접근자를 제공한다.
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions/get
const obj = {
log: ['a', 'b', 'c'],
get latest() {
return this.log[this.log.length - 1];
}
};
console.log(obj.latest);
// expected output: "c"