# 18 DRY penguins


#1


error unexpected end of input.
I'm almost positive my code is correct...But I'm obviously missing something super tiny that's keeping my code from passing.


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

Hi you didn't close the Penguin class

// define a Penguin class
function Penguin(name){
    this.name = name;
    this.numLegs = 2;
} <--

// set its prototype to be a new instance of Animal

#3

ugh!!! Thank you! It really sucks to be stuck that long for something so small


#4

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