zip es-toolkit
Creates an array of tuples by bundling elements at the same index from multiple arrays.
Usage
zip(...arrs)
Use zip when you want to bundle elements at the same position from multiple arrays together. It returns a new array where elements at the same index from each array are bundled into tuples.
If the arrays have different lengths, it adjusts to the longest array's length. Empty positions in shorter arrays are filled with undefined.
Parameters
arrsArray<readonly T[]>required
The arrays to bundle.
Returns
Returns a new array where elements at the same index from each input array are bundled into tuples.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.