Tell us what’s happening:
While I understand the spirit of the challenge, I want to understand how the bird and dog objects are associated or linked to the animal super-object?
Your code so far
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");
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36
.
Challenge: Use Inheritance So You Don’t Repeat Yourself
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/use-inheritance-so-you-dont-repeat-yourself