20/30 Properly define Emporor in constructor


So I don't know whats wrong here, it seems pretty simple, It prints the answer, but I get an error message. Thanks

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

// create your Emperor class here and make it inherit from Penguin
function Emporor(name){
this.name = name;

// create an "emperor" object and print the number of legs it has
Emporor.prototype= new Penguin();
var emporor= new Emporor("Chris");



Have a close look at your emperor



Thanks. I caught that after I posted it. D'oh!


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