Different ways of creating objects in JS. Read on Github Using Object literal object created in the is an example of creating JavaScript object using object literal. human previous article Using new Object() syntax Creating objects using new Object() and object literal does the same thing. For simplicity, readability and execution speed, use object literal. We can add new properties and methods to the above objects using the dot and/or square notation. Object Constructor Constructor function in JavaScript is used for creating new objects using a blueprint. Just like classes are used for creating objects in Java, C# we can use constructors to create objects in JavaScript. Objects can be created using the constructor function syntax using the following two steps: Define the object (class) by defining the constructor function. By convention, name of the constructor function should start with capital letter blueprint Create the object by instantiating the constructor function using operator new Example: This is just the blueprint. To create the object we will use the new operator. var viratKohli = new Human("Virat", "Kohli"); var sachinTendulkar = new Human("Sachin", "Tendulkar"); Another method to create object using Object.create is explained here Other articles: An Extensive Guide To Progressive Web Applications Let’s get this ‘this’ once and for all Service Workers Service Workers implementation Virtual DOM in ReactJS this is JavaScript Execution Context in JavaScript Prototypes in JavaScript Inheritance in JavaScript Object.create in JavaScript Objects in JavaScripts is how hackers start their afternoons. We’re a part of the family. We are now and happy to opportunities. Hacker Noon @AMI accepting submissions discuss advertising & sponsorship To learn more, , , or simply, read our about page like/message us on Facebook tweet/DM @HackerNoon. If you enjoyed this story, we recommend reading our and . Until next time, don’t take the realities of the world for granted! latest tech stories trending tech stories