UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

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