5: Who's in your bracket


#1

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

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

// print the value of the first property of "james"
// using the variable "aProperty"
console.log(aProperty);

When I press save and submit I am 'greeted' with
"Oops, try again. Do you have the variable 'aProperty' between brackets?"


#2

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

var aProperty = "job";

console.log(james[aProperty]);

//I hope it helps!


#3

Thanks for the help!


#4

I have the same problem...


#5

My code below, the same as yours that you say works, does not work with me. Why?

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]);

Please help


#6

Wierd. I went out, tried something else, went back in, re-submitted the same code and then it worked!
Thanks.


#7

this exercise apparently has a bug. refresh, submit same code, next


#8

I had the same thing. Even tried to print "Test" and it would not, Must be a bug in the system because like you guys said it worked after a refresh.