Utilizor
Contact Us

Nested Objects

Objects inside objects.

Nested Objects

Values in an object can be another object.

myObj = { name:"John", age:30, cars: { car1:"Ford", car2:"BMW", car3:"Fiat" } }

You can access nested objects using the dot notation or the bracket notation.

Example

myObj.cars.car2;