DEV Community

Discussion on: šŸ”„ Create number ranges in JavaScript

Collapse
 
alfredosalzillo profile image
Alfredo Salzillo • Edited

Why not

Array(5).fill(0).map((_, i) => I)
Enter fullscreen mode Exit fullscreen mode

Instead of keys and destructuring

Collapse
 
domhabersack profile image
Dom Habersack

I find the shorter version easier to read, but Iā€™d go with your line if performance was more important. šŸ‘ Thanks for sharing it!