2 title: no-array-constructor
11 Use of the `Array` constructor to construct a new array is generally
12 discouraged in favor of array literal notation because of the single-argument
13 pitfall and because the `Array` global may be redefined. The exception is when
14 the Array constructor is used to intentionally create sparse arrays of a
15 specified size by giving the constructor a single numeric argument.
19 This rule disallows `Array` constructors.
21 Examples of **incorrect** code for this rule:
26 /*eslint no-array-constructor: "error"*/
35 Examples of **correct** code for this rule:
40 /*eslint no-array-constructor: "error"*/
44 new Array(someOtherArray.length)
53 This rule enforces a nearly universal stylistic concern. That being said, this
54 rule may be disabled if the constructor style is preferred.