Bellone Park
Bellone Park
다들 느끼고 있는 점이 비슷하네요. 저 역시도 궁금해서 적어봅니다. a(value){ this._a = 5; this.calculate(); } 이 함수와 set a(value){ this._a = 5; this.calculate(); } 이 함수는 부를때 numbers.a(5)로 부르느냐(일반적인 함수)...
const numbers = { _a: 1, _b: 2, sum: 3, calculate(){ console.log('calculate'); this.sum = this._a + this._b; }, a(value){ this._a = value; this.calculate(); }, set b(value){ this._b = value; this.calculate();...
https://mygumi.tistory.com/161 다른분들 참고하세요. 이거 읽으니 좀 알 것 같네요. _name을 가리기 위해서 객체.setter함수를 쓰면, 확실히 변수이름을 모르게 만들 수 있으니 은닉은 되겠네요.