Prelude API
    Preparing search index...

    Function step

    • Returns a generator that yields every nth element from the input iterable. The first element is always included.

      Type Parameters

      • T

        The type of elements in the iterable

      Parameters

      • modulo: number

        The step size (every nth element)

      Returns (values: Iterable<T>) => Generator<T>

      Elements at positions where the index modulo equals zero

      G.pipe(
      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
      G.step(3),
      G.array
      ) // [1, 4, 7, 10]