•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.
Categories: Javascript