import { Enumerable } from "https://deno.land/x/proc@0.22.1/mod.ts";
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"]