class 강아지생성기 {
constructor( type, color ){
this.type = type;
this.color = color;
}
한살먹기(){
if(typeof this.age == 'undefined'){ // 왜 'undefined'만 되지?
console.log('ERROR')
} else {
this.age++;
}
}
}
class 고양이생성기 extends 강아지생성기 {
constructor(type, color, age){
super(type, color);
this.age = age
}
}
if(typeof this.age == 'undefined'){ // 왜 'undefined'는 되고 undefined는 안되는지 궁금합니다.