Skip to content

Files

Latest commit

 

History

History
19 lines (13 loc) · 438 Bytes

no-unreadable-array-destructuring.md

File metadata and controls

19 lines (13 loc) · 438 Bytes

Pattern: Skipping multiple array elements in destructuring

Issue: -

Description

While array destructuring is useful, skipping consecutive elements with empty slots makes code harder to read and understand. Consider using array methods or explicit indexing for clearer intent.

Examples

Example of incorrect code:

const [, , foo] = parts;

Example of correct code:

const [foo] = parts;