Learn JavaScript
Rest and Spread
23.5
Lesson

Use Spread operator to copy arrays and objects

We can use the spread operator to copy an array or an object.

In the example given above, we are using the spread operator to copy array1 into array2.

In the example given above, we are using the spread operator to copy object1 into object2.