Home / Search/ Language Reference/ Functions/ Scalar Functions/ Dynamic Functions/zip

zip

The zip function merges two or more dynamic arrays, grouping elements of the same index.

Syntax

     zip( Arrays )

Parameters

NameTypeRequiredDescription
ArraysdynamicYesThe dynamic array values to zip.

Returns

Returns an array whose elements are each an array holding the elements of the input arrays of the same index.

Example

print foo = zip(dynamic([1,3,5]), dynamic([2,4,6]))

Output:

{
  "foo": [
    [
      1,
      2
    ],
    [
      3,
      4
    ],
    [
      5,
      6
    ]
  ]
}