Marching Penguins


#1



Hi! I just want know why it's working. 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
     var Penguin = Animal;
     // our test code
     var theCaptain = new Penguin("Captain Cook", 2);
     theCaptain.sayName();


#2

Hi in this lesson they aske you to

// create a Penguin constructor here


// create a sayName method for Penguins here

a constructor look like that
a constructor of Cat for example

function Cat(name, lastname) {
    this.name = name;
    this.lastname = lastname;
}

for the method you could look the one for Animal.