JavaScript Rest vs Spread Operator – What’s the Difference?

1 · freeCodeCamp.org · Sept. 15, 2021, 10:41 p.m.
JavaScript uses three dots (...) for both the rest and spread operators. But these two operators are not the same. The main difference between rest and spread is that the rest operator puts the rest of some specific user-supplied values into a JavaScript array. But the spread syntax expands iterables into...