17/30 whats wrong?


#1

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

// create a Penguin constructor here
function Penguin (name,numLegs){
this.name = name;
this.numLegs = numLegs;
}

// create a sayName method for Penguins here
Penguin.prototype.sayName = fuction(){
console.log("Hi my name is " + this.name)
}

// our test code
var theCaptain = new Penguin("Captain Cook", 2);
theCaptain.sayName();

Oops, try again. There was a problem with your syntax.


#2

@cssmaster90864,
Change your

Penguin.prototype.sayName = fuction(){

into

Penguin.prototype.sayName = function(){