Discuss / JavaScript / 只想写class继承,不想写原型继承

只想写class继承,不想写原型继承

Topic source

断桥-过后

#1 Created at ... [Delete] [Delete and Lock User]
class Cat extends Animal{
  constructor(name){
    super(name);
  }

  say(){
    return `Hello, ${this.name}!`;
  }
}

  • 1

Reply