UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

10 lines (9 loc) 235 B
export function range(a, b) { const start = b === undefined ? 0 : a const end = b === undefined ? a : b if (end<= start) { return [] } const len = end - start return Array.from({ length: len + 1 }, (_, i) => start + i) }