JavaScript uses three dots (…) for both the rest and spread operators. But these two operators are not the same.

RMAG news

Spread Operator:

The spread operator is used to expand an iterable (like an array, string, or object) into its individual elements. It’s commonly used for copying or concatenating arrays, or passing elements of an array as arguments to a function.

Please follow and like us:
Pin Share