JS Built-ins
Iteratordestructuringbeginner

Iterator: destructuring generator

πŸ“– Usage Example
const [a, b, c] = [1, 2, 3]
console.log(a, b, c) // β†’ 1 2 3
const [head, ...tail] = [10, 20, 30]
console.log(head, tail) // β†’ 10 [20, 30]

Destructuring uses the iterator protocol to unpack values from an iterable into distinct variables.

Check destructuring with generator.