Marching Penguins


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

``` 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();
<do not remove the three backticks above>

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