I don't understand the error message


#1


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


So.. This is the error, and I don't understand what it means, can someone explain it to me? By the way I am not a native speaker.
Oops, try again. Do you have the variable 'aProperty' between brackets?

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)

//This is the code ^^


#2

You need to set this variable to the value of the object which is "programmer" and not the key which is job:.

And also, after that line you need to call the object james with the variable aProperty in brackets like this,

james[aProperty];

#3

Thank you for the solution!


#4

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