Javascript

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.

Please check below video for more detailed explaination with examples:

Let me know your doubts and questions in Comment section of the video.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s