Page 61 - Nodejs 교과서 개정2판
P. 61
},
getCandy() {
this.status.count--;
return this.status.count;
},
};
const { getCandy, status: { count } } = candyMachine;
ടझۣѷ݅ ਤ ٘ ޙߨ ਬബೠ ޙߨੑפ candyMachine ё উ ࣘࢿਸ ইࢲ ߸ࣻ৬ ݒடפ
countۢ ৈ۞ ױ҅ উ ࣘࢿب ਸ ࣻ णפ getCandy৬ count ߸ࣻо ୡӝചػ Ѫੑפ ݅ ҳ
ઑ࠙೧ ೡਸ ࢎਊೞݶ ೣࣻ thisо ׳ۄ ࣻ णפ getCandy ೣࣻܳ ࢎਊ೧ࠁࣁਃ ׳ۄ thisܳ ਗ
ې۽ ߄Լ۰ݶ bind ೣࣻܳ ٮ۽ ࢎਊ೧ঠ פ
ߓৌী ೠ ҳઑ࠙೧ ೡ ޙߨب ઓפ
var array = ['nodejs', {}, 10, true];
var node = array[0];
var obj = array[1];
var bool = array[3];
arrayۆ ߓৌ ߣ૩ ف ߣ૩ ਃࣗ৬ ֎ ߣ૩ ਃࣗܳ ߸ࣻী ੑೞח ٘ੑפ
җ э ߄Ե ࣻ णפ
const array = ['nodejs', {}, 10, true];
const [node, obj, , bool] = array;
য࢝೧ ࠁ݅ աܴ۽ ӏ णפ node obj bool ਤܳ ࠁݶ nodeח ߓৌ ߣ૩ ਃࣗ objח
ف ߣ૩ ਃࣗ CPPM ֎ ߣ૩ ਃࣗۄח Ѫਸ ঌ ࣻ णפ obj৬ bool ࢎ ਃࣗੋ 10ীח ߸ࣻݺਸ য
ঋওਵ۽ 10 ޖदפ
ҳઑ࠙೧ ೡ ޙߨب ٘ ࣻܳ ࢚ ৈ۽ ਬਊפ ౠ ֢٘ח ݽٕ दझమਸ ࢎਊೞ۽ ۞
ೠ ߑधਸ ॺפ ݽٕ दझమ ীࢲ ࣁ ঌইࠁѷणפ
ېझ
ېझ ޙߨب ୶оغणפ ೞ݅ ܲ যۢ ېझ ӝ߈ਵ۽ زೞח Ѫ ইפۄ ৈ ۽షఋ
ੑ ӝ߈ਵ۽ زפ ۽షఋੑ ӝ߈ ޙߨਸ ࠁӝ જѱ ېझ۽ ߄Դ ѪۄҊ ೧ೞݶ ؾפ