Accessing Object Properties

This lesson discusses 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:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy