Skip to main content
Module

x/better_iterators/mod.ts>RangeArgs

Chainable iterators (sync and async) for TypeScript, with support for opt-in, bounded parallelism
Go to Latest
interface RangeArgs
import { type RangeArgs } from "https://deno.land/x/better_iterators@v1.2.1/mod.ts";

Properties

optional
from: number

default: 0

optional
to: number

default: Number.MAX_SAFE_INTEGER

optional
step: number

default: 1

optional
inclusive: boolean

default: false

Like ranges in many other languages, a range by default includes its start, but not its end. If true, this will cause the range to include its end.

import { range } from "./mod.ts"

// [1, 2]:
console.log(range({from: 1, to: 3}))

// [1, 2, 3]:
console.log(range({from: 1, to: 3, inclusive: true}))