zip
Combines multiple arrays element-by-element into an array of tuples. The result length equals the length of the shortest input array.
The inverse of unzip.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
a | readonly A[] | First array |
b | readonly B[] | Second array |
Returns
Section titled “Returns”[A, B][] — Array of [a, b] pairs
Examples
Section titled “Examples”Pair keys with values
Section titled “Pair keys with values”Combine two arrays element-by-element.
Truncates to the shorter array
Section titled “Truncates to the shorter array”Stops at the end of the shorter array to avoid undefined entries.
