function Animate() {
this.age = 12
}
Animate.prototype = {
say() {
console.log(this.age)
}
}
new Animate().say()
function Dog() {}
Dog.prototype = Animate.prototype// 请问这个也可以用Object.create(Animate.prototype),那么用和不用有什么区别吗,求解
let dog = new Dog()
dog.say()郎朗坤
Helenr
相关分类