Object literal notation JavaScript
In this article, we will discuss Object literal notation in JavaScript.
Creating objects using object literal: {}
While creating objects using object literal, we use pair of flower brackets instead o “new object()”
Syntax :
var objectname = { };
Example :
var react1 = { };
Execution
When the system finds{} on the RHS equal to the symbol, it follows 3 steps
- Create new empty objects
- sets the value of implicit prototype “__proto__+ of a new empty object to object.prototype
- Returns the reference of a new object.