> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# zip es-toolkit

Creates an array of tuples by bundling elements at the same index from multiple arrays.

```typescript
const zipped = zip(...arrs);
```

## 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.

```typescript
import { zip } from 'es-toolkit/array';

// Bundle two arrays.
zip([1, 2, 3], ['a', 'b', 'c']);
// Returns: [[1, 'a'], [2, 'b'], [3, 'c']]

// Bundle three arrays.
zip([1, 2], ['a', 'b', 'c'], [true, false]);
// Returns: [[1, 'a', true], [2, 'b', false], [undefined, 'c', undefined]]
```

If the arrays have different lengths, it adjusts to the longest array's length. Empty positions in shorter arrays are filled with `undefined`.

```typescript
import { zip } from 'es-toolkit/array';

zip([1, 2], ['a', 'b', 'c', 'd']);
// Returns: [[1, 'a'], [2, 'b'], [undefined, 'c'], [undefined, 'd']]
```

#### 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.

```typescript
T[][]
```


Source: es-toolkit

Re-exported verbatim from [`es-toolkit`](https://es-toolkit.dev/reference/array/zip.html). Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.
