For understanding the spread operator and rest operator ,lets us understand first Destructing in JavaScript.
Destructuring assignment
In JavaScript, "destructuring" is a way to extract values from arrays or objects and assign them to variables in a m...