JavaScript interview question


Basic  to  Advance  JavaScript 
Interview Questions

1. ### What are the possible ways to create objects in JavaScript?

There are many ways to create objects in javascript as below,

a. **Object constructor:**

 The simplest way to create an empty object is using Object constructor. Currently this approach is not recommended.



 ```javascript
 var object = new Object();
 ```


 b. **Object's create method:**

 The create method of Object creates a new object by passing the prototype object as a parameter
 ```javascript
 var object = Object.create(null);
 ```



Answer Continue Next page....


Comments