Spread operator allows an iterable to expand in places where 0+ arguments are expected. It is mostly used in variable array where there is more than 1 values are expected. Syntax of Spread operator is same as Rest operator but it works completely opposite of it.
var variablename1 = [...value];
In the above syntax, … is spread operator which will target all values in particular variable.
Copying value from one array to another. In this code, Spread Operator basically run a inbuilt for loop like structure for user so that all values can be copied to another variable
1, 2, 3, 4, 5, 6
Performing operation using spread operator:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.