common-stuff
    Preparing search index...

    Function zip

    • Combines multiple iterables element-wise into tuples, stopping at the shortest.

      If any input is an AsyncIterable, the result is a Promise<Array<…>>.

      Type Parameters

      • T extends readonly (Iterable<unknown, any, any> | AsyncIterable<unknown, any, any>)[]

      Parameters

      • ...inputs: T

      Returns T[number] extends Iterable<unknown, any, any>
          ? { [K in string | number | symbol]: IterableItem<T[K<K>]> }[]
          : Promise<{ [K in string | number | symbol]: IterableItem<T[K<K>]> }[]>

      zip([1, 2, 3], ['a', 'b', 'c'])
      // [[1, 'a'], [2, 'b'], [3, 'c']]

      zip([1, 2, 3], ['a', 'b'], [true, false, true])
      // [[1, 'a', true], [2, 'b', false]] // shortest wins