ITs All in the Genes


#1

Got an error on this, but it still allowed me to pass to the next exercise?

// 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' + penquin )
}

// provided code to test above constructor and method
var penguin = new Animal("Captain Cook", 2);
penguin.sayName();


#2

Animal.prototype.sayName = function() {
    console.log("Hi my name is " + this.name);
}

The Hint suggested specifically to use this.name