method Enumerable.prototype.unzip
Enumerable.prototype.unzip<
A,
B,
>
(): Unzip<T>

Unzip a collection of [A, B] into Enumerable<A> and Enumerable<B>.

Note that this operations uses tee, so it will use memory during the iteration.

Example

const [a, b] = enumerate([[1, "A"], [2, "B"], [3, "C"]]).unzip();

// a is number[] -> [1, 2, 3]
// b is string[] -> ["A", "B", "C"]

Type Parameters

Return Type

Unzip<T>

Two enumerables, one for the left side of the tuple and the other for the right.

Usage

import { Enumerable } from ".";