Slide 31
Slide 31 text
const arr1 = [1, 2, 3]
const arr2 = [4, 5, 6]
const arr3 = […arr1, …arr2]
const arr4 = […arr3, 7, 8]
// arr3: [1, 2, 3, 4, 5, 6]
// arr4: [1, 2, 3, 4, 5, 6, 7, 8]
The ES6: The spread operator (...)
Does essentially what it says on the tin — it spreads
something iterable into a list.