HELP! DRY Penguins


#1

keep on saying SyntaxError: missing before statement

Replace this line with your code. 

// 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( name ) {
    this name = name;
    this.numLegs = 2;
}
// set its prototype to be a new instance of Animal
Penguin.prototype = new Animal();


#2

[stdin]:12
    this name = name;
         ^^^^
SyntaxError: Unexpected identifier

#3

What does that mean?!?!?!


#4

never mind,got it.thx


#5

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