class Father extends Grandfather {
constructor() {
super(name);
this.age = 50;
}
}
이렇게 짜면 에러가 발생하지 않는데,
class Father extends Grandfather {
constructor() {
super(name,age);
this.age = 50;
}
}
이렇게 짜면 에러가 발생해서
class Father extends Grandfather {
constructor(name, age) {
super(name,age);
this.age = 50;
}
}
이렇게 해줘야 에러가 사라지네요. 왜 파라미터가 한 개일때는 에러가 발생하지 않고 두 개부터 발생하는 것일까요..?