Animal prototype example not working


Oops, try again. It looks like your Animal.prototype.sayName method does not properly log to the console 'Hi my name is [name]' where [name] is the name of the Animal

// 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("Hi my name is  " +;

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


You are going to be really annoyed at this solution...

But there is only supposed to be one space here. You have two spaces after the word is.

Let me know if that worked.


LOL. Yes thanks that worked.


Please mark my reply as the solution so this thread can be closed :slight_smile:


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