Dry penguin


// 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(){

// 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...


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