In JavaScript, We can create an empty object using curly braces {} and
the Object
constructor.
Example: Using curly braces {} and we are not intializing with any value as we want an empty object.
Javascript
let emptyObject = {}; |
Example: Using Object
constructor.
Javascript
let anotherEmptyObject = new Object();
|
Both approaches result in the creation of an empty object. Once you have an empty object, you can later add properties and values to it as needed.