4 ms·
Array.from({ length: 5 }).forEach(fn)
by blinger 8y ago
Array.from({ length: 5 }).forEach(fn)
- Waterluvian 8y agoOh not bad. I wasn't aware of that! I'm guessing it constructs the whole array upfront. Maybe there's a generator way to do it too.