dot notation will search literally for that property
so if you have obj.prop it will try to access a property named prop, equivalent of using obj["prop"]
if you want instead the property with the name held by the variable prop you need to use bracket notation obj[prop], in this way it will first get the value from inside the variable and then access the property
Yep, I totally agree with @ILM, I wanted just to add that in the future you will see that the bracket notation will be also useful when you try to access properties with names composed with more than a word or in general with special characters.