Prelude API
    Preparing search index...

    Function zip

    • Combines multiple iterables into a generator of tuples containing values at corresponding positions. Stops when any of the input iterables is exhausted.

      Type Parameters

      • Args extends Iterable<unknown, any, any>[]

        Array of iterable types

      Parameters

      • ...iterables: Args

        Input iterables to zip together

      Returns Generator<{ [K in string | number | symbol]: Value<Args[K]> }>

      Tuple containing values from each iterable at the current position

      G.pipe(
      G.zip([1, 2, 3], ['a', 'b', 'c']),
      G.array
      ) // [[1, 'a'], [2, 'b'], [3, 'c']]

      // With different length iterables, stops at shortest
      G.pipe(
      G.zip([1, 2], ['a', 'b', 'c']),
      G.array
      ) // [[1, 'a'], [2, 'b']]