class Cat extends Animal {
constructor(name) {
super(name) // 记得用super调用父类的构造方法!
}
say() {
return `Hello, ${this.name}!`
Sign in to make a reply
Niko
class Cat extends Animal {
constructor(name) {
super(name) // 记得用super调用父类的构造方法!
}
say() {
return `Hello, ${this.name}!`
}
}