5. Code is correct, but not working


#1

I put in the correct code for number 5, but it said that "James's job was not logged to the console." However, when I input the code into the Codecademy Labs editor, it worked right. Here is the code that I did:

var james = {
    job: "programmer",
    married: false
};

// set to the first property name of "james"
var aProperty = "job"

// print the value of the first property of "james" 
// using the variable "aProperty"

console.log(james[aProperty])

#2

Passes on my end and it looks right to me.
If you've changed some variable that shouldn't be changed (like console.log) then refreshing the page might fix that. If that doesn't help either, another browser (If you're running something other than Firefox/Chrome/Chromium or if you might have some interfering browser extensions). Or skip the exercise.


#3

Last line you are missing a semicolon.

console.log(james[aProperty]);


#4

That fixed it. Thank you!


#5

Refreshing the page worked for me!


#6

Worked for me as well!