Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Docs: Document the "correct" way to build an array with values (#13246)
* Document the "correct" way to build an array with values

* Merge example code blocks
  • Loading branch information
edg2s committed May 20, 2020
1 parent 88127d7 commit 0891379
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions docs/rules/no-array-constructor.md
Expand Up @@ -16,10 +16,6 @@ Examples of **incorrect** code for this rule:
/*eslint no-array-constructor: "error"*/

Array(0, 1, 2)
```

```js
/*eslint no-array-constructor: "error"*/

new Array(0, 1, 2)
```
Expand All @@ -30,12 +26,10 @@ Examples of **correct** code for this rule:
/*eslint no-array-constructor: "error"*/

Array(500)
```

```js
/*eslint no-array-constructor: "error"*/

new Array(someOtherArray.length)

[0, 1, 2]
```

## When Not To Use It
Expand Down

0 comments on commit 0891379

Please sign in to comment.