class animals {
constructor(type, color) {
this.type = type;
this.color = color;
}
nextAge() {
if(this instanceof cats) {
this.age++
}
}
}
/*
let dog1 = new animals('maltize', 'white');
let dog2 = new animals('gindotgae', 'borwn');
console.log(dog1)
*/
class cats extends animals {
constructor(type, color, age){
super(type, color);
this.age = age;
}
}
let cat1 = new cats('koreanshot', 'orange', 5);
let cat2 = new cats('russianblue', 'gray', 2);
console.log(cat1.nextAge())
무슨 문제인지 모르겠습니다 ㅠㅠㅠㅠㅠㅠ