代码里并没有看到继承关系


#1

function Cat(name) {
this.name = name;
}

Cat.prototype = {
constructor: Cat,

};

function Bear(name) {
this.name = name;
}

Bear.prototype = {
constructor: Bear,

};

function Animal() { }

Animal.prototype = {
constructor: Animal,
eat: function() {
console.log(“nom nom nom”);
}
};