Spread operator, rest operator, and destructuring assignment in JavaScript
Spread expands values, rest collects remaining values, and destructuring pulls parts of arrays or objects into variables.
- Spread copies one level deep
- Rest gathers leftovers
- Destructuring works with arrays and objects
Spread operator, rest operator, and destructuring assignment in JavaScript