Skip to content

Function.lazyZip

github-actions[bot] edited this page Nov 18, 2026 · 13 revisions

umt / lazyZip

Function: lazyZip()

lazyZip<T>(...iterables): Generator<T, void, undefined>

Defined in: Iterator/lazyZip.ts:10

Lazily combines values from several iterables at corresponding positions Stops as soon as any iterable is exhausted and then closes every source iterator.

Type Parameters

T

T extends unknown[]

Parameters

iterables

...{ [K in string | number | symbol]: Iterable<T[K], any, any> }

The source iterables

Returns

Generator<T, void, undefined>

A generator yielding one tuple per position

Example

const pairs = lazyZip([1, 2, 3], ["a", "b"]);
[...pairs]; // [[1, "a"], [2, "b"]]

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally