@zip
Combine two arrays element-wise into an array of pairs.
Returns: array
Syntax
Section titled “Syntax”@zip(a b)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
a |
array |
First array to zip |
b |
array |
Second array |
Examples
Section titled “Examples”# Zip two arraysset $keys [1 2 3]set $vals ["a" "b" "c"]set $pairs @zip($keys $vals)See Also
Section titled “See Also”- @unzip — split pairs into two arrays
- @enumerate — pair elements with indices