Package: effect
Module: Array
Splits an array of pairs into two arrays. Inverse of zip.
Example (Unzipping pairs)
import { Array } from "effect"
console.log(Array.unzip([[1, "a"], [2, "b"], [3, "c"]])) // [[1, 2, 3], ["a", "b", "c"]]
See
zip — combine two arrays into pairsSignature
declare const unzip: <S extends Iterable<readonly [any, any]>>(self: S) => S extends NonEmptyReadonlyArray<readonly [infer A, infer B]> ? [NonEmptyArray<A>, NonEmptyArray<B>] : S extends Iterable<readonly [infer A, infer B]> ? [Array<A>, Array<B>] : never
Since v2.0.0