Tell us what’s happening:
Ok, so either I’m totally missing the point or something is missing. I see nothing that is associating Dogs or Birds with Animal in any way. If this is being covered in future lessons, then ok, but I can’t see those lessons until I finish here and i don’t like moving forward till I understand something.
At this point I feel like I’m being told that if Susan and Bob have the same property, that I should create another prototype (a “superprototype”). I see no difference between a regular prototype and a super prototype though. This new prototype might be called people, but it could just as easily be called Tom.
So what’s the point? I can’t create the same object twice from two different constructors with what I’ve learned so far…
**Your code so far**
function Cat(name) {
this.name = name;
}
Cat.prototype = {
constructor: Cat,
eat: function() {
console.log("nom nom nom");
}
};
function Bear(name) {
this.name = name;
}
Bear.prototype = {
constructor: Bear,
eat: function() {
console.log("nom nom nom");
}
};
function Animal() { }
Animal.prototype = {
constructor: Animal,
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
Challenge: Use Inheritance So You Don’t Repeat Yourself
Link to the challenge: