Exercies 20 - emperor penguins


i'm not seeing my syntax error.
"Make sure to log the number of legs emperor has!"

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


In this, you have to use

Emperor.prototype = new Penguin();

to solve this level, as shown in the directions and hint.

You do not make a function in this level, as you have done here:

I believe you should take that out, if it still doesn't work, refresh.


It works fine for me


:smiley: yea i agree with u


your code should look like this
The console wants you to change the name of "Emperor"
to another object Name of preference. Your code is very valid its just the console setup.
Try and see if it works for you.

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

function Emperor(name){
this.name = name;
Emperor.prototype = new Penguin();

var Scoth = new Emperor("Drakonia");


I logged out and back in and it started to work, so it may have just needed a refresh.
Thank you for all the help!
I'm now wrestling with JQuery - yahoo.


Yeahh..! Thanks dear.. After 8 times it passed me..