What's wrong? Please help (16 lesson)


#1

This is my code and it print what the exercice want but it tell me that's wrong. Why?
// create your Animal class here
function Animal(name, numLegs) {
this.name = name;
this.numLegs = numLegs;
}

// create the sayName method for Animal
Animal.prototype.sayName = function () {
console.log("Hi my name is" + this.name);
}

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

Thanks for your help.


#2

Try it be expanding your

with 1 extra space-character
like
"Hi my name is "


#3

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