Prelude API
    Preparing search index...

    Function take

    • Returns a generator that yields at most the first n elements from the input iterable.

      Type Parameters

      • T

        The type of elements in the iterable

      Parameters

      • n: number

        Maximum number of elements to take

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

      A generator function that yields the first n elements

      When n is not a safe integer

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