Destructuring an Array

This lesson goes over destructuring an array.

Case 1: Moving data into a variable #

Destructuring an array puts data into separated variables, swaps data, or collects the remaining items of an array.

The first case is moving data into a variable. The assignment starts by having on the left side of the equal sign different variables between square brackets, separated by a comma. On the right side, you have the array.

Get hands-on with 1200+ tech skills courses.