Skip to main content

Function: rangeUntil()

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

console.log([...rangeUntil(0, 6)])
//=> [ 0, 1, 2, 3, 4, 5 ]

console.log([...rangeUntil(0, 6).step(2)])
//=> [ 0, 2, 4 ]

rangeUntil(start)

rangeUntil<Start>(start): <End>(end) => RangeIterable

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

Type Parameters

Start extends number

Parameters

start: Integer<Start>

Returns

Function

Type Parameters

End extends number

Parameters

end: Integer<End>

Returns

RangeIterable

Throws

if either start or end is not an integer.

Example

console.log([...rangeUntil(0, 6)])
//=> [ 0, 1, 2, 3, 4, 5 ]

console.log([...rangeUntil(0, 6).step(2)])
//=> [ 0, 2, 4 ]

Defined in

generators.d.ts:235

rangeUntil(start, end)

rangeUntil<Start, End>(start, end): RangeIterable

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

Type Parameters

Start extends number

End extends number

Parameters

start: Integer<Start>

end: Integer<End>

Returns

RangeIterable

Throws

if either start or end is not an integer.

Example

console.log([...rangeUntil(0, 6)])
//=> [ 0, 1, 2, 3, 4, 5 ]

console.log([...rangeUntil(0, 6).step(2)])
//=> [ 0, 2, 4 ]

Defined in

generators.d.ts:235