Learn JavaScript
Array Destructuring
34.5
Lesson

Using Default Values

If the number of elements in the array is lesser than the number of variables, then the absent values are considered undefined.

We can store default values for the variables. The default values are used only when the array element is missing.