Rest Pattern and Parameters
//SPREAD, because on RIGHT side of =
const arr = [1, 2, ...[3, 4]]

//REST because on LEFT side of =
const [a, b, ...others] = [1, 2, 3, 4, 5];

console.log(a, b, others);   //result: 1 2 (3)[3, 4, 5]
by გიორგი ბაკაშვილი
4 years ago
JavaScript
Arrays
0
Pro tip: use ```triple backticks around text``` to write in code fences