Can't find the error in my code


#1


https://www.codecademy.com/courses/objects-ii/3/5?curriculum_id=506324b3a7dffd00020bf661#


Error message pops up saying "It looks like you didn't set up Emperor to inherit from Penguin!", but I can't find my error


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;
};
Emporer.prototype = new Penguin();
// create an "emperor" object and print the number of legs it has
    var emporer = new Emporer("Stan");
    console.log(emporer.numLegs);


#2

if you did it right the check your spelling. look at what you have written versus what the error msg is telling you


#3

Hahah thanks rydan. problem solved.


#4

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