Inherit Behaviors from a Supertype... Define objects

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 :smile:

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

Hello,

let duck = Object.create(Animal.protoype); // Change this line
let beagle = Object.create(Animal.prototype);; // Change this line

JavaScript is case-sensitive, you have to put the O on Object upper-case and that should solve it!

Thanks for that, I did try this and it didnt work, also for some reason whrn I do change to case of the O, the word changes to black instead of blue.

I found the problem… I was missing a T in prototype :grimacing: :laughing: