Accessing Object Properties

This lesson discusses the different ways to access properties, such as using dot operator and square brackets.

There are various ways to access object properties. We will discuss each method in detail below.

Dot Operator

In JavaScript, an object literal can be accessed using the dot operator. To access any property, the name of the object should be mentioned first, followed by the dot operator and then the name of the property encapsulated in that object.

Example

Let’s take a look at an example:

Get hands-on with 1400+ tech skills courses.