Dot Notation vs Array Notation in JavaScript

preview_player
Показать описание
Dot Notation vs Array Notation in JavaScript:

We can use dot notation as well as array notation to access object properties.

The dot notation is used mostly as it is easier to read and comprehend.

Bracket notation allows us to access object properties using variable whereas dot notation does not.

Array notation is used in cases where we are not sure about the keys. For Example: There may be space in properties name.

Рекомендации по теме