Dry penguin


#1

// the original Animal class and sayName method
function Animal(name, numLegs) {
this.name = name;
this.numLegs = numLegs;
}
Animal.prototype.sayName = function() {
console.log("Hi my name is " + this.name);
};

// define a Penguin class
function Penguin(){
this.name=name;
this.numLegs=2;
};

// set its prototype to be a new instance of Animal
Penguin.prototype = new Animal();

whts wrong with this ????im getting an error like Oops, try again. The Penguin constructor should take in a single argument 'name' and save it as this.name
any help would be appreciated...


#2

oooops sry... my bad forgot to type name inside the paranthesis ......