Tell us what’s happening:
I don’t see what i’m missing here
Your code so far
function Animal() { }
Animal.prototype.eat = function()
{
console.log("nom nom nom");
};
function Dog() { }
// Add your code below this line
Dog.prototype.constructor = Animal;
Dog.prototype = Dog;
Dog.prototype.bark = function(){
console.log("Woof!");
}
// Add your code above this line
let beagle = new Dog();
beagle.eat() // Should print "nom nom nom"
beagle.bark(); // Should print "Woof!"
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance/