What's wrong? Please help (16 lesson)


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);

Thanks for your help.


Try it be expanding your

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


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