Advertisement
Google Ad Slot: content-top
JS Rest and Spread Operator
The Rest (...) and Spread (...) operators both use three dots (...) but serve different purposes based on their context.
Rest Operator (...)
The Rest Operator is used to collect remaining arguments into an array.
It is primarily used in function parameters.
Spread Operator (...)
The Spread Operator is used to expand iterable elements (like arrays or objects) into individual elements.