Penguins, Properties and the Prototype


The error I receive is : Oops, Try Again. Make sure to log the number of legs emperor has.

The thing is I am fairly certain the code is correct. When I open my browser's JavaScript console and copy and run my code the correct number, 2, is logged to the browser. If you see something in my code, please tell me what I am doing wrong. Otherwise I guess it's just a bug.

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


Your code does not give any error, refresh the page,Maybe it help!


i got the same code but this error keeps popping out "Oops, try again. Make sure to log the number of legs emperor has!"


I got the same error. Refreshing the page solved the problem.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.