Introduction to Dynamic Property Access
Premium
You learned how to read object properties with dot notation in the objects series. This lesson shows what to do when the property name lives in a variable: bracket notation. You'll see why obj.key and obj[key] behave differently and when each one is the right tool.