Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Dot notation vs Bracket notation in JavaScript
The dot notation and bracket notation both are used to access the object properties in JavaScript. The dot notation is used mostly as it is easier to read and comprehend and also less verbose. The main difference between dot notation and bracket notation is that the bracket notation allows us to access object properties using variable.
Following is the code for bracket notation vs dot notation in JavaScript −
Example
Document Dot notation vs Bracket notation in JavaScript
Click on the above button to access the student1 object properties using dot and bracket notation
Output

On clicking the ‘CLICK HERE’ button −

Advertisements
