Printing numLegs of emperor


#1



Penguins, Properties, and the Prototype


Oops, try again. Make sure to log the number of legs emperor has!


Replace this line with your 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;
}
// create an "emperor" object and print the number of legs it has
Emperor.prototype = new Penguin();

var emperor = new Emperor("eee");

console.log(emperor.numLegs);


#2

@yasminamran,
Your code is Ok.

Maybe you have to Refresh you Browser

Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= https://discuss.codecademy.com/t/how-do-i-format-code-in-my-posts/28351
[extra's]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet