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



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!


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");


HI try to refresh the page....


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