Learn JavaScript
Array Destructuring

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.