Page 63 - Nodejs 교과서 개정2판
P. 63
breathe() {
alert('h-a-a-a-m');
}
}
class Zero extends Human {
constructor(type, firstName, lastName) {
super(type);
this.firstName = firstName;
this.lastName = lastName;
}
sayName() {
super.breathe();
alert(`${this.firstName} ${this.lastName}`);
}
}
const newZero = new Zero('human', 'Zero', 'Cho');
Human.isHuman(newZero); // true
߈ਵ۽ class উਵ۽ Ӓܛചػ Ѫਸ ࠅ ࣻ णפ ࢤࢿ ೣࣻח constructor উਵ۽ ٜযщҊ Human i
sHuman э ېझ ೣࣻח static ఃਕ٘۽ ജغणפ ۽షఋੑ ೣٜࣻب ݽف class ࠶۾ উী ನೣ
غয যڃ ೣࣻо যڃ ېझ ࣗࣘੋ ࠁӝ औणפ ࢚ࣘب рױ೧ઉࢲ extends ఃਕ٘۽ औѱ ࢚ࣘ оמ
פ ݅ ۧѱ ېझ ޙߨਵ۽ ߄Շ؊ۄب ߄झ݀ח ۽షఋੑ ӝ߈ਵ۽ زೠח Ѫਸ ݺब
೧ঠ פ
۽झ
߄झ݀৬ ֢٘ীࢲח ۽ ࠺زӝܳ פ ౠ ߮ ܻझցܳ ࢎਊೡ ٸ ߔ ೣࣻܳ ࢎਊ
פ &4 ࠗఠח ߄झ݀৬ ֢٘ "1*ٜ ߔ न ۽झ 1SPNJTF ӝ߈ਵ۽ ҳࢿغݴ ঈݺ
֫ ߔ ৠ DBMMCBDL IFMM അ࢚ਸ ӓࠂ೮ח ಣоܳ ߉Ҋ णפ ۽झח ߈٘द ঌইفযঠ ೞח ё
۽ ଼ࡺ݅ ইפۄ ܲ ܐٜਸ ଵҊ೧ࢲۄب ߈٘द ࣼ೧ঠ פ
۽झח җ э ӏ णפ ݢ ۽झ ёܳ ࢤࢿ೧ঠ פ
const condition = true; // true면 resolve, false면 reject
const promise = new Promise((resolve, reject) => {
if (condition) {