Penguins,properties and the Prototype


#1

Hello,

What is wrong with below code...?Help please!

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

function Emperor(name){
this.name=name;
};

Emperor.prototype = new Penguin();
var emperor = new Emperor("Peter");

console.log (emperor.numLegs);


#2

What error are you getting?


#3

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