Skip to content

Muthukrishnan

AI, Computer Vision, Algorithms and Mathematics

  • About me
April 27, 2016
  • 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);

Tags: 4

Retrieved February 7, 2025 at 1:39 pm (website time).

Available at: write.muthu.co/?p=184

Post navigation

Previous
โ€น for…in statement to loop through the javascript object properties
Next
Inheritance in Javascript โ€บ
My Recently Published Book

ยฉ 2023 Muthukrishnan