It's All in the Genes. Don't understand why


#1

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

I have output: "Hi, my name is Captain Cook". But: "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"

What Is Wrong?


#2

@blogrunner15156,

Have a close look at

your

Hi, my name is" + " " + this.name

and they ask

Hi my name is [name]


#3

thank's) I saw unnecesary coma in my sentence)))