16 oop ii


#1

Can someone explain to me what is wrong with my 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();

It gives me an error saying "It looks like your Animal constructor does not take in two arguments and save them as 'this.name' and 'this.numLegs' respectively."


#2

Never mind I figured it out it was a small error in caps for numLegs