Hi there i have a question about inheritance
in this code
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");
}
};
namely , i understand that Animal is a supertype of the two animals cat and bear and thus they are inheriting the method, however i do not understand where the link is ,
i assumed there would be some code to link the cat and bear as subtypes of the animal however i do not see where it is.