20. Penguins, Properties, and the Prototype - Not working


#1


https://www.codecademy.com/courses/objects-ii/3/5?curriculum_id=506324b3a7dffd00020bf661#


I can't tell what's wrong with my code. It seems correct to me, but I am keeping receiving error message for not logging the number of emperor's legs.
"Oops, try again. Make sure to log the number of legs emperor has!"

Any hint is appreciated. Thanks a bunch!

Nathan


function Penguin(name) {
    this.name = name;
    this.numLegs = 2;
}

// create your Emperor class here and make it inherit from Penguin
function Emperor(name){
    this.name = name;
};
Emperor.prototype = new Penguin();

// create an "emperor" object and print the number of legs it has
var emperor = new Emperor("Dome");
console.log(emperor.numLegs);


#2

HI try to refresh the page....


#3

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