"job" is just a string.
aProperty is assigned a reference to the string object in memory. When we query the variable, we are actually querying the object it points to.
console.log(aProperty, typeof aProperty); // job string
Property names (keys) are also strings. That's why when we use subscript (bracket) notation to reference a property we have to enclose it in quotes.
console.log(james['job']); // programmer
We should note that it is not a variable named
job but a property specific name that can only be referenced as a member of the parent object.
A variable is not a variable if it is in quotes. That makes it a string. But since it references a string, in our case, it can be used to represent that property name:
console.log(james[aProperty]); // programmer