Accessing Object's Properties
There are two ways to access a property of an object:
- Using square bracket notation, for example hero['occupation']
- Using the dot notation, for example hero.occupation
There are two ways to access a property of an object: