We can use the spread operator
to insert the elements of an array
into another array.
In the example given above,
we are using the spread operator
to insert the elements from studentMarks
into studentMarksCopy
.
In addition,
we can also add other elements to an array,
along with the spread operator,
as shown in the example below.
Similarly,
we can insert elements from multiple arrays at once.