Penguins, Properties, and the Prototype - Issue


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

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

// create an "emperor" object and print the number of legs it has
var emperor = new Emperor("fred");

Here is my code. Every time I run it, it errors: Oops, try again. Make sure to log the number of legs emperor has!. I'm not sure what is wrong with the code. Any suggestions?


The code looks correct, and passes when I tested it. Cannot reproduce the error in FF. Try to refresh the page and submit again.


I refreshed the browser and it worked. Must be a bug or something.


Thanks for bringing up this issue. I had the same problem, came to the Q&A Forum and refreshed as mtf suggested. This 'refreshing the page' solution helped me out too!