Course Content
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:
Task
Complete the following code by creating a new array called numbers
and append the elements of both even
and odd
arrays (in this order) to the numbers
array. Do it in a single line of code.
Section 1.
Chapter 7