Function Graph Overview
    Preparing search index...

    Function zip

    • Zips multiple arrays together, creating tuples of elements at corresponding indices. Stops iterating when the shortest input array is exhausted.

      Type Parameters

      • T extends unknown[]

        An array of input arrays with potentially different element types

      Parameters

      • ...arrays: [...{ [K in string | number | symbol]: T[K<K>][] }[]]

        Multiple input arrays to be zipped together

      Returns Generator<T, void, unknown>

      A generator yielding tuples containing one element from each input array

      const nums = [1, 2, 3];
      const strs = ['a', 'b', 'c'];
      [...zip(nums, strs)] // [[1, 'a'], [2, 'b'], [3, 'c']]