let person = {
name: ['Bob', 'Smith'],
age: 32,
gender: 'male',
interests: ['music', 'skiing'],
bio () {
// 이런식으로 객체 리터럴 안에서 key값 따로 없이, function 선언 따로 없이 함수를 선언하고 사용할 수 있음.
console.log(`${this.name[0]} ${this.name[1]} is ${this.age} years old`);
},
};
const func = (item) => {
return person[item]()
}
console.log(func('bio'))
// Bob Smith is 32 years old
vue options에 있는 훅들도 이런 형태였지 않았을까...?