JavaScript Spread Operators
Spread is an array/object expiration to be expanded in places where zero more key value pairs are expected. Spread allows iterators over the arguments.
Spread in Function calls
The Syntax Spread function is as follows:
Functioncall(…iterableObject);
Spread in array literals
Array concatenation using spread literals.
The Syntax of Spread in array concatenation using spread literals is as follows:
var arrObj1 = [1,2,3,4,5];
var arrObj2 = [6,7,8,9,10];
var combined = […arrObj1, … arrObj2 ]
console.log(combined)
Example
Output
Spread Operators
Apple,Grapes,Banana