Destructuring Example 13

Destructuring arrays - spread operator

by shravan

Babel + JSX

let numbers = [1, 2, 3, 4, 5];

let [a, b, ...others] = numbers;

console.log(a, b); //1 2

console.log(others); //[3,4,5]