Day 29: Mopping up
Lesson 4: Spread Operator
If you have an array or object that you want to split apart you can use the spread operator
.... There are a few places to use this but most common is spreading one array into another.
Likewise for spreading an object into another.
You can also use spread along with destructuring.
In the previous destructuring object example you might want to destructure two properties and then spread the rest.
You can see that
rest contains the rest of the object properties.
Likewise you can do the same with arrays.
The spread operator is sometimes call the rest operator