Use Inheritance So You Don't Repeat Yourself help

Use Inheritance So You Don't Repeat Yourself help
0.0 0

#1

Tell us what’s happening:

So I’m not sure what is the issue here? As far as I can see my code is correct?

Your code so far


function Cat(name) {
  this.name = name; 
}

Cat.prototype = {
  constructor: Cat, 
    console.log("nom nom nom");
  }
};

function Bear(name) {
  this.name = name; 
}

Bear.prototype = {
  constructor: Bear, 
    console.log("nom nom nom");
  }
};

function Animal() { }

Animal.prototype = {
  constructor: Animal,
  eat: function() {
    console.log("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/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/use-inheritance-so-you-dont-repeat-yourself/


#2

There are few syntax problems that’s all ^^
An object is composed of key-value pairs, you can’t put in there a wild console.log :stuck_out_tongue: