Oops, try again. Make sure to properly define the Emperor constructor! Don't know what is wrong with this code


#1

`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

var emporer = new Emporer("Hello");
console.log(emporer.numLegs);
`


#2

There is no legs in Emporer function try to add one.


#3

Oops, try again. Make sure to properly define the Emperor constructor!
This is the error I get on adding legs to Emporer


#4

No, your code is correct! It's just a simple spelling mistake. You have written "Emporer" and "emporer" everywhere.
It's "Emperor" and "emperor". Just switch the e and o.


#5

I am gonna kill myself for this...!!!


#6

Thank you for this, was stuck on this for like 10 minutes with the correct output into console.