Junior JavaScript

What is array destructuring?

Extract elements from arrays into variables.

Example:

let [first, second] = [10, 20];

console.log(first, second); // 10 20

More from JavaScript Tutorial

All questions for this course