Function range

  • Returns a Stream that yields numbers starting from 'start' up to 'start + count - 1'.

    Parameters

    • start: number

      The first number in the range.

    • count: number

      The number of elements in the range.

    • by: number = 1

      The step between elements.

    Returns Stream<number>

    A Stream that yields numbers in the range.

    const result = range(1, 5, 2);
    console.log([...result]); // [1, 3, 5]