method Enumerable.prototype.zip
Enumerable.prototype.zip<U>(other: AsyncIterable<U>): Enumerable<[T, U]>

Zip two Enumerables together. If collections are unequal length, the longer collection is truncated.

Example

const a = range({ from: 1, until: 3 });
const b = enumerate(["A", "B", "C"]);

const result = a.zip(b);

// [[1, "A"], [2, "B"], [3, "C"]]

Type Parameters

Parameters

other: AsyncIterable<U>

The other iterable.

Return Type

Enumerable<[T, U]>

The result of zipping

Usage

import { Enumerable } from ".";