You’ve learnt how to create an object. Now, let's check how you can access values inside an object.
To access the properties of an object, we can either use the dot notation or bracket notation.
Example:
var book = {name: 'Dubliners', author: 'James Joyce'};
Dot Notation:
book.name
or
book.author
Bracket Notation:
book['name']
or
book[''author'']
It is important to remember that in bracket notation, if the name of your key is a string, then you need to enclose it within quotes inside the square brackets.