20. Penguins, properties and prototypes


#1

I'm getting an error "Oops, try again. Make sure to log the number of legs emperor has!"
I can't see the error in my code! Any help?

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("Black & Gold");
console.log(emperor.numLegs);


#2

Hi try to refresh the page.


#3

I think it might be the semicolons instead of commas ....


#5

When I took the spaces out of my emperor name (in your case "Black & Gold") this problem went away.

I still don't understand why...