Intro to Objects II, #20: Emperor is broken based on browsers


#1

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

This will work in Firefox, but not in Chrome. Screenshot:

Imgur


function Penguin(name, numLegs) {
    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();

var emperor = new Emperor("Emp");
console.log(emperor.numLegs);


#2

Unable to reproduce this error in Chrome/Windows 7. As we can see, I am behind the times (why toss aside Windows Professional?) so cannot speak for later versions of Windows.

In the screenshots we can see that nothing is logged making the error message legit. Tough to say how it came about, though.


#3

Also on Windows 7. I know nothing is logged, but the exact same code is in both browsers. I copied and pasted it back and forth.

edit: just tried again and it worked now. That's odd. Some other people in a different thread mentioned browser-related problems with this question too.


#4

The intermittency makes it difficult to nail down a cause. Being one of the original courses means it will not get another audit. Good that you could get passed and move on.


#5

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