Skip to main content

Variable: rangeUntil

const rangeUntil: Range

Defined in: generators.d.ts:458

Returns a RangeIterable that yields the integers between start and end including start, but excluding end.

Throws

if either start or end is not an integer.

Example

import { join, pipe, rangeUntil } from 'lfi'

console.log(
pipe(
rangeUntil(0, 6),
join(`, `),
),
)
//=> 0, 1, 2, 3, 4, 5

console.log(
pipe(
rangeUntil(0, 6).step(2),
join(`, `),
),
)
//=> 0, 2, 4
Playground

Since

v0.0.1