Files
30-seconds-of-code/test/initializeArrayWithRange/initializeArrayWithRange.js
2018-01-09 06:09:49 -05:00

2 lines
139 B
JavaScript

module.exports = (end, start = 0, step = 1) =>
Array.from({ length: Math.ceil((end + 1 - start) / step) }).map((v, i) => i * step + start);