1. You can access object properties in two ways.
Example:
this function takes in one parameter, which is called name. When
This example demonstrates how to access the age of our person object. This
example demonstrates how to access the age of our person object.
Object
Properties
objectName.propertyName
//or
objectName['propertyName']
var person = {
name: "James", age: 41,
favMeal: “pizza", height: 153
};
var x = person.age;
var y = person['age'];