20. Not working?


#1

I see there is another thread with this problem but it has been incorrectly marked as solved. It seems everything is ok, and the console prints the proper answer,,, but then it keeps saying "Make sure to properly define the Emperor constructor!"

Here is my code

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

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

Emporer.prototype = new Penguin;

// create an "emperor" object and print the number of legs it has

emporer = new Emporer("Ahmet");
console.log(emporer.numLegs);

#2

Hey its a minor mistake. @mradamd. You just mispleled Emperor you created the class like:

 function Emporer(name) { 
    this.name = name; 
}

But should be like this(class name diffrent):

function Emperor (name) { 
    this.name = name; 
}

#3

oh yes... oops! :flushed: Thanks!