It all about Genes (What did I do wrong?)


it says that I have not added a name, but I think I have so I don't know what Im doing wrong.

// create your Animal class here
function Animal(name, numLegs) { = name;
    this.numLegs = numLegs;

// create the sayName method for Animal

Animal.prototype.sayName = function() {
    console.log ("hello my name is " + name)

// provided code to test above constructor and method
var penguin = new Animal("Captain Cook", 2);


put a semicolon( ; ) at the end of the animal class.. and try this...

Animal.prototype.sayName = function(){
console.log("Hi my name is " + "" +;

worked for me!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.