Describing the spread Operation
- The
spreadoperator is represented using...the syntax - It allows an iterable to be expanded as arguments
- This iterable can be an array, string, etc.
- This operator is useful in function calls
Defining an Array
let fruits = ['Apple', 'Banana'];
console.log(fruits.length);
// 2Defining a Custom Function
function combine(x, y) {
return x + y;
}Using the spread Operation
console.log(combine(...fruits));
// "AppleBanana"Next