Skip to content

@zip

Combine two arrays element-wise into an array of pairs.

Returns: array

@zip(a b)
Name Type Description
a array First array to zip
b array Second array
# Zip two arrays
set $keys [1 2 3]
set $vals ["a" "b" "c"]
set $pairs @zip($keys $vals)
  • @unzip — split pairs into two arrays
  • @enumerate — pair elements with indices