5. WHO's in your Bracket!?


#1


Greetings and SALUTATIONS



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

Code behaved correctly but I am a bit confused as to why it worked? Doesn't setting aProperty to a string ("job") set aProperty to the literal value of "job"? So why does printing aProperty call the first property value of the object james? Thank you for any help!


#2

aProperty = "job"
printing james[aProperty] is similar to james["job"] because we have aProperty = "job". so james["job"] means job property of james object.


#3

Thank you so much! Makes total sense now, mustve been looking at the screen for too long


#4

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