Function range

  • Creates a Stream of ascending numbers starting from from and ending just before bound. If bound is omitted, the stream will continue indefinitely.

    Parameters

    • from: number

      The starting value (inclusive).

    • bound: number = Infinity

      The end value (exclusive). Defaults to Infinity, resulting in an endless stream.

    Returns Stream<number>

    A stream of ascending numbers starting from from and, if bound is provided, ending just before bound.