JavaScript10 min read

JavaScript Array Destructuring and Rest

Master array destructuring. Learn to extract values, skip elements, and use rest operator.

Alex Thompson
Dec 17, 2025
24.5k784

JavaScript Array Destructuring

Basic Destructuring

const numbers = [1, 2, 3];
const [first, second, third] = numbers;

Skipping Elements

const [first, , third] = numbers; // Skip second

Rest in Destructuring

const [first, ...rest] = numbers;
// first = 1, rest = [2, 3]

Key Takeaway

Array destructuring extracts values easily. Skip with empty slots. Use rest to get remaining items.

#JavaScript#Destructuring#Arrays#ES6#Intermediate