0 votes
in JavaScript by
What are the different ways to access object properties?

1 Answer

0 votes
by

There are 3 possible ways for accessing the property of an object.

  1. Dot notation: It uses dot for accessing the properties
objectName.property;
  1. Square brackets notation: It uses square brackets for property access
objectName["property"];
  1. Expression notation: It uses expression in the square brackets
objectName[expression];
...