5/30 Why can not?


#1

Why? "Oops, try again. It looks like james' job was not logged to the console." I do not see an error.
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

you're making the process a little more difficult than it needs to be.

Try getting rid of the whole "var aProperty" thing, and stick to the basics.

console.log(james[job]);

#3

I got rid of the var, but still "Oops, try again. Do you have the variable 'aProperty' between brackets?"


#4

possible error here developer?


#5

did you change what you had in the console.log to resemble what I had?


#6

Did it work in the end?


#8

It specifically says "In line 7, set aProperty to a string of the first property in james (ie. the job property).

Then print james's job using bracket notation and aProperty." If we do not use the aProperty variable then it fails because that is the whole goal of the lesson


#9

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