ELI5 JavaScript: The Spread Operator
One of the most useful features introduced in ES6 is the Spread Operator. It is denoted by three dots (...).
According to MDN Web Docs:
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero ...
nisargkapkar.hashnode.dev4 min read
Vaibhav Rai
Frontend developer
๐ To the point, if possible can you add a small reference on how to find whether some object is iterable or not, it will easier to relate why cases like these won't work;
const one = {1: 1, 2: 2}; const b = [...one]