3 ms·
Traditional for loops are probably the most common for ranges but if you want a more functional approach you can use the Array constructor or Array.prototype.fr
by halfmatthalfcat 6y ago
Traditional for loops are probably the most common for ranges but if you want a more functional approach you can use the Array constructor or Array.prototype.from with its various parameters.
- franky47 6y agoThe functional approach also works better as a one-liner when typed in the devtools console.