Your Animal constructor does not take in two arguments and save them as 'this.name' and 'this.numLegs' respectively


#1

This only worked when i copy and pasted another user's code from the forum, and submited it. The code was the exact same as mine. and yes i did try to switch browsers.

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

other person's code:
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();


#2

You forgot to capitalize the L in 'numLegs'.