DEV Community

Discussion on: 6 Use Cases of Spread with Array in JavaScript

Collapse
 
wrldwzrd89 profile image
Eric Ahnell

Fun! I can see a somewhat unusual use for this: in web games, you need arrays for various reasons. It’s usually more efficient to store only one dimension, even if the data isn’t, and simulate a multidimensional array. Spread gives a convenient way to make the simulation less annoying for consumers, from the perspective of a JS library.

Collapse
 
samanthaming profile image
Samantha Ming

Interesting, thanks for sharing! 🎮