Tell us what’s happening:
Describe your issue in detail here.
How Animal object became supertype(parent) here? Animal object is declared same as Bear and Cat, and how eat() method works for Bear and Cat?
**Your code so far**
function Cat(name) {
this.name = name;
}
function Bear(name) {
this.name = name;
}
function Animal() { }
Animal.prototype = {
constructor: Animal,
eat: function() {
console.log("nom nom nom")
}
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Challenge: Use Inheritance So You Don’t Repeat Yourself
Link to the challenge: