Don't know what's wrong with my code


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"
var aProperty = ‘job’;

Error messages keeps saying;
Oops, try again. Do you have the variable ‘aProperty’ between brackets?


Hey @april.mouwad
To put it simply, your code after the // set to the first property name of "james"
comment, it’s NOT asking you to use bracket notation yet to access the value. The first property is just “job”, so set that var aProperty to job.

Your next issue is the console.log statement, james is an object not a string value, so remove the “” and -> console.log(james[“aProperty”]);

Hope this helps!!!


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