20. Penguins, properties and prototypes


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


Hi try to refresh the page.


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


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...