Please help me with my code


#1

Here is my code

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


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


#2

I realized that, thanks


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.