Page 56 - Nodejs 교과서 개정2판
P. 56
const y = 3;
}
console.log(y); // Uncaught ReferenceError: y is not defined
٘ח ܁ ѐߊ بҳ ' $POTPMF చী ਵݶ ؾפ &OUFS ܳ ־ܰݶ ٘о प೯غחؘ ٘ܳ प
೯ೞ ঋҊ ߄Էਸ ೞ۰ݶ 4IJGU &OUFS ܳ ੑ۱פ
xח ࢚ਵ۽ ۱غחؘ yח ী۞о ߊࢤפ varਸ const۽ ߄Ծਸ ࡺੋؘ ରо ߊࢤೞח Ѫੑפ v
ar ೣࣻ झܳ о۽ ifޙ ࠶۾җ ҙ҅হ Ӕೡ ࣻ णפ ೞ݅ DPOTU৬ let ࠶۾ झ
ܳ о۽ ࠶۾ ߆ীࢲח ߸ࣻী Ӕೡ ࣻ হणפ ࠶۾ ߧਤח if while for function ١ীࢲ ࠅ ࣻ
ח Қഐ \৬ ^ ࢎ ੑפ ೣࣻ झ न ࠶۾ झܳ ࢎਊೣਵ۽ॄ ഐझ э ޙઁب ೧ѾغҊ
٘ ҙܻب ࣻਘ೧णפ
const letҗ var झ ઙܨо ܵפ Ӓۧݶ const৬ let р ରח ޖੌөਃ constח ೠ ߣ ч
ਸ ೡೞݶ ܲ чਸ ೡೡ ࣻ হणפ ܲ чਸ ೡೞ۰Ҋ ೞݶ ী۞о ߊࢤפ ژೠ ୡӝചೡ ٸ
чਸ ೡೞ ঋਵݶ ী۞о ߊࢤפ ٮۄࢲ const۽ ࢶೠ ߸ࣻܳ ࢚ࣻۄҊ ࠗܰӝب פ
ઁܳ ೠ ঀ ٮۄ ੑ۱೧ࠁࣁਃ
const a = 0;
a = 1; // Uncaught TypeError: Assignment to constant variable.
let b = 0;
b = 1; // 1
const c; // Uncaught SyntaxError: Missing initializer in const declaration
/PUF DPOTU৬ MFU ী যו Ѫਸ ॄঠ ೞաਃ
߄झ݀ܳ ࢎਊೡ ٸ ೠ ߣ ୡӝച೮؍ ߸ࣻী ܲ чਸ ೡೞח ҃ח ৻۽ णפ ٮۄࢲ ߸ࣻ ࢶ दীח ӝ
ࠄਵ۽ constܳ ࢎਊೞҊ ܲ чਸ ೡ೧ঠ ೞח ࢚ട ࢤ҂ਸ ٸ letਸ ࢎਊೞݶ ؾפ
మ݁ ޙৌ
&4 ޙߨী ࢜۽ ޙৌ ࢤ҂णפ ޙৌ ٮ১ա ٮ১۽ хऱח ӝઓ ޙৌҗ ܰ
ѱ ߔ౮ A ਵ۽ хषפ 5BC ਤী णפ ౠೠ ޙৌ উী ߸ࣻܳ ֍ਸ ࣻ ח Ѫੑפ
ӝઓ &4 ޙߨਸ ࢎਊೠ ޙৌੑפ