You’re right the variable someProp does not belong to myObj - this is why myObj.someProp or myObj["someProp"] is undefined - but myObj[someProp] is evaluated by first filling in the value of someProp so it becomes myObj["propName"] which is defined and has value "Some Value"
Quotes around property names are not required if the name is a valid identifier name e.g. a name without spaces like propName that can be used for a variable. But property names can be any string so it’s okay to say obj = { "prop A": "value of prop A" } - quotes are also not needed if the property name is a number obj = { 123: "value of prop 123" }