unzip
Splits an array of tuples into separate arrays, one per position.
The inverse of zip.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pairs | readonly [A, B][] | null | undefined | Array of 2-tuples to unzip |
Returns
Section titled “Returns”[A[], B[]] — A tuple of two arrays: all first elements and all second elements
Examples
Section titled “Examples”Split pairs into separate arrays
Section titled “Split pairs into separate arrays”The inverse of zip — separate each position into its own array.
