From 08913798b4ec420b261b8fbc470504f9f248c840 Mon Sep 17 00:00:00 2001 From: Ed S Date: Wed, 20 May 2020 17:34:34 +0100 Subject: [PATCH] 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 --- docs/rules/no-array-constructor.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/rules/no-array-constructor.md b/docs/rules/no-array-constructor.md index 863f56d0b77..22fbde64ef0 100644 --- a/docs/rules/no-array-constructor.md +++ b/docs/rules/no-array-constructor.md @@ -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) ``` @@ -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