Introduction to React
ES6 Spread Operator
The spread operator (
…) can be easily used to assign an array's values to another array.
Changing the position of the
...arr term will change the position of data in the output:
The spread operator
… unpacks the array
arr elements and places them at the location. This can be used in many flexible ways, like passing arguments to a function:
Complete the following code by creating a new array called
numbers and append the elements of both
odd arrays (in this order) to the
numbers array. Do it in a single line of code.