Who's in your bracket? Explanation if you please


Hello all. I have passed this exercise, but am still confused as to how the string value in aProperty is able to access the variable property of james. In other words, how does aProperty become a property of james? Thanks in advance.


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"


First, it is important to recognize that property names are strings. When we assign the string job to aProperty we are assigning a string that is also a property name.


is actually accessing



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