Spread And Rest Operator
Spread and Rest Operator have same syntax which is denoted by ... .
Spread Operator
Spread operator is used to spread elements of an array into individual element. Using spread operator, we can copy elements of an array in to a new array or properties of an object in to a new object. The spread syntax works only with iterables.
Example :
Rest Operator
Rest operator gathers or collects items. Mostly used while destructuring and function declarations. This rest operator must be at the end as shown in the example.
Example :