noSparseArray
此内容尚不支持你的语言。
Diagnostic Category: lint/suspicious/noSparseArray
Since: v1.0.0
Sources:
- Same as:
no-sparse-arrays
Disallow sparse arrays
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.js:1:1 lint/suspicious/noSparseArray FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This array contains an empty slot.
> 1 │ [1,,2]
│ ^^^^^^
2 │
ℹ Unsafe fix: Replace hole with undefined
1 │ [1,·undefined,2]
│ ++++++++++