Referencing Objects within Objects
To get to the deeper properties of an object within another object we can use dot extension or subsequent bracket notation.
Dot notation:
console.log(myBookBox.book1.title);
This logs out the Strange Case of Dr Jekyll and Mr Hyde.
Wit bracket notation: console.log( myBookBox["book1"]["author"] );
This logs out Robert Louis Stevenson.
Last updated
Was this helpful?