Hi there, I am stuck on this challenge, I need to define the objects of the two animals. What changes do I need to make to complete the task? Thanks in acvance
Your code so far
function Animal() { }
Animal.prototype = {
constructor: Animal,
eat: function() {
console.log("nom nom nom")
}
};
// Add your code below this line
let duck = object.create(Animal.protoype); // Change this line
let beagle = object.create(Animal.prototype);; // Change this line
duck.eat(); // Should print "nom nom nom"
beagle.eat(); // Should print "nom nom nom"
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype