11 The `Object` constructor is used to create new generic objects in JavaScript, such as:
14 var myObject = new Object();
17 However, this is no different from using the more concise object literal syntax:
23 For this reason, many prefer to always use the object literal syntax and never use the `Object` constructor.
25 While there are no performance differences between the two approaches, the byte savings and conciseness of the object literal form is what has made it the de facto way of creating new objects.
29 This rule disallows `Object` constructors.
31 Examples of **incorrect** code for this rule:
36 /*eslint no-new-object: "error"*/
38 var myObject = new Object();
45 Examples of **correct** code for this rule:
50 /*eslint no-new-object: "error"*/
52 var myObject = new CustomObject();
56 var Object = function Object() {};
64 If you wish to allow the use of the `Object` constructor, you can safely turn this rule off.