DEV Community

Discussion on: You don't know spread operator !

Collapse
 
parsyvalentin profile image
Valentin PARSY

The Number primitive wrapper object is used EVERYWHERE. If you change anything that "low-level" in your code, it will change it everywhere in your code/app, potentially changing the behavior of (in this example) every Number you use.

As a solution you could have your own IterableNumber, that is a Number to which you set the Symbol.iterator property. (not sure it is a good solution though)