Code not working


#1

can anybody suggest why this code isn't working. It is showing an error: james' job was not logged to the console.

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

I'm not sure why it's not working. Have you tried refreshing the page?

Your code is trying to output james['job'], which is valid way to access object properties (but object.property is more common). I believe it is codecademy bug and resetting code or refreshing page should help.


#3

Yes indeed it was a bug. It worked after I tried a few hours later. Anyways thankx for looking into it.


#4

Having the exact same issue and it worked after refreshing the page