DEV Community

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

Posted on

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

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.

Top comments (0)