in Javascript

Different ways of creating an object in Javascript

//1. using curly braces
var myVar = {};

//2. using new operator
var myVar = new Object();

//3. using the Object.create method
var myVar = Object.create(Object.prototype);

Write a Comment

Comment