variable destructuring javascript in array code example
Example 1: destructure array javascript
var [first, second, ...rest] = ["Mercury", "Earth", ...planets, "Saturn"];
Example 2: destructure to object
({x: oof.x, y: oof.y} = foo);
var [first, second, ...rest] = ["Mercury", "Earth", ...planets, "Saturn"];
({x: oof.x, y: oof.y} = foo);