Skip to main content
InterviewHubPRO
Section Overview
Q229

Question 229 of 536

Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

43%
JavaScript & V8 Internals (536 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

What are the different ways to access object properties

junior LevelMost AskedCode ExampleEvent LoopPrototypes

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

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