class Animal { constructor(name) { this.name = name; } } class Cat extends Animal { say() { return 'hello, ' + this.name; } } var cat2 = new Cat('ketty'); console.log(cat2.say()); //hello, ketty
Sign in to make a reply
未来有妮和我