Discuss / JavaScript / 作业

作业

Topic source

Niko

#1 Created at ... [Delete] [Delete and Lock User]

class Cat extends Animal {

    constructor(name) {

        super(name) // 记得用super调用父类的构造方法!

    }

    say() {

         return `Hello, ${this.name}!`

    }

}


  • 1

Reply