Exercise number 20


#1

When I run the following code I get a message as Oops, try again. It looks like you didn't set Emperor to inherit from Penguin! on the console I get a message as ReferenceError: Pengiun is not defined

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 Pengiun();

// create an "emperor" object and print the number of legs it has
var emperor = new Emperor("Philip");
console.log(emperor.numLegs);


#2

@vikramtheone

Have a close look at

Pengiun