...spread operator

…spread = flatten or ‘spread’ values out.

Like concat but look how simple it is to see what should be in the array. Can add new values to the array also.


const numbersfromXList = [65, 201, 1000, 99];
const numbersfromYList = [6, 21, 981, 61, 7];

console.log( [...numbersfromXList, ...numbersfromYList] ); 
// [65, 201, 1000, 99, 6, 21, 981, 61, 7]

console.log( [76, ...numbersfromXList, ...numbersfromYList] ); 
// [76, 65, 201, 1000, 99, 6, 21, 981, 61, 7]
// can add in new elements as well as concat