super(props) 왜 작성해야 할까?
class Person {
constructor(name) {
this.name = name;
};
};
const PolitePerson extends Person {
constructor(name) {
this.greetColleagues(); // 이것은 허용되지 않는다. 이유를 읽어보자
super(name);
};
greetColleagues() {
alert('Good morning folks!');
};
};Last updated
Was this helpful?