Help pls 18/30


Oops, try again. The Penguin constructor should always set this.numLegs to 2. The constructor should only take a single parameter!

Replace this line with your code. 
function Penguin(name){ = name;
this.numLegs = 2;

Penguin.prototype = new Animal();
Animal.prototype.sayName = function() {
console.log("Hi my name is " +;

// create a Penguin constructor here

function Penguin(name, numLegs){ = name;
this.numLegs = numLegs;
// create a sayName method for Penguins here

Penguin.prototype.sayName = function(){
console.log("Hi my name is " +
// our test code
var theCaptain = new Penguin("Captain Cook", 2);


i dont get it what did i do wrong


where did your animal class go? which was at the beginning in the exercise


@laytondalton, It looks like you were on the right track with your Penguin class. But remember, if you want your Penguin class to inherit from the Animal class, you must first build an Animal class.

Refer back to your old example for a guide to how to build this properly. Hint: It will look exactly like your Penguin class, except with one additional parameter, "numLegs".


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