Generate range of numbers with JavaScript

With Lodash it can be done easily by _.range

However with plain JavaScript the most simple solution would be using Array.from which is available since ES6.

Array.from(new Array(n), (_val, index)=> index + start)


Post a Comment

Previous Post Next Post