20/ 30 Please help me


#1

can u please help me , below is the 8th version of my code:
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 test = new Emperor("PPG");
console.log(test.numLegs);


#2

You have to create an object by the name emperor.
var emperor=new Emperor("PPG");
console.log(emperor.numLegs);

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("PPG");
console.log(emperor.