1) Object literal syntax:
The object literal syntax (or object initializer), is a comma-separated set of name-value pairs wrapped in curly braces.
Note: This is an easiest way to create an object.
2) Object constructor:
The simplest way to create an empty object is using the Object constructor. Currently this approach is not recommended.🙅♂️
The Object() is a built-in constructor function so "new" keyword is not required. The above code snippet can be re-written as:
var object = Object();
3) Object's create method:
The create method of Object is used to create a new object by passing the specificied prototype object and properties as arguments. i.e., This pattern is helpful to create new objects based on existing objects. The second argument is optional and it is used to create properties on a newly created object.
The following code creates a new empty object whose prototype is null.
var object = Object.create(null);
4) Function constructor:
In this approach, create any function and apply the new operator to create object instances.
5) Function constructor with prototype:
This is similar to function constructor but it uses prototype for their properties and methods,
This is equivalent to an instance created with an object create method with a function prototype and then call that function with an instance and parameters as arguments.
6) ES6 Class syntax:
ES6 introduces class feature to create the objects
7) Singleton pattern:
A Singleton is an object which can only be instantiated one time. Repeated calls to its constructor return the same instance and this way one can ensure that they don't accidentally create multiple instances.
@Diyorbekk_dev