UNPKG

async-promises

Version:

Async control flow patterns using promises based on https://github.com/caolan/async

18 lines (13 loc) 312 B
'use strict'; module.exports = function range(start, end, step) { let index = -1, length = Math.max(Math.ceil((end - start) / (step || 1)), 0); const result = Array(length); while (length > 0) { index += 1; result[index] = start; start += step; length -= 1; } return result; };