父类Person有一些公共属性及方法,不需要每次声明构造函数重复写,所以便出现了继承的概念。
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
sayHello =
父类Person有一些公共属性及方法,不需要每次声明构造函数重复写,所以便出现了继承的概念。
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
sayHello =