Prelude API
    Preparing search index...

    Function range

    • Generates a sequence of numbers from start to end inclusive. If end > start and no step is provided, step defaults to 1. If end < start and no step is provided, step defaults to -1.

      Parameters

      • start: number

        The first number in the sequence

      • end: number

        The last number in the sequence

      • Optionalstep: number

        Optional step between numbers (default: inferred from start/end)

      Returns Generator<number>

      Numbers from start to end with the given step

      G.pipe(
      G.range(1, 5),
      G.array
      ) // [1, 2, 3, 4, 5]

      G.pipe(
      G.range(10, 1, -2),
      G.array
      ) // [10, 8, 6, 4, 2]