noSparseArray
诊断类别:lint/suspicious/noSparseArray
¥Diagnostic Category: lint/suspicious/noSparseArray
自从:v1.0.0
¥Since: v1.0.0
来源:
¥Sources:
-
与以下相同:
no-sparse-arrays
¥Same as:
no-sparse-arrays
禁止稀疏数组
¥Disallow sparse arrays
¥Examples
¥Invalid
code-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]
│ ++++++++++
¥Related links