Method does not properly log to the console


Despite having the console print exactly what the author desires, I keep receiving a prompt that the method does not properly log to the console. Here's my code:

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


A very, VERY confusing thing, but it's a problem.

Change this:

To this:

console.log("Hi my name is" + " ";

They want you to do it that way, even though it's the same.:smiley:


I did. I still get the same message:

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"



never mind. I noticed I had a comma after 'Hi", which was the issue.