ZIP
Zip two lists together

Description

Given two lists, returns a list of lists, where the first list contains the first items of the source lists, the second list contains the second items and so on.
If the lists don't have an equal number of items, the extra items are discarded.

Function signature

1
ZIP(list1: Array, list2: Array) => Array
Copied!
Parameter
Description
List 1
First list to zip
List 2
Second list to zip

Examples

1
numbers = [100,3,20,50]
2
numbers2 = [1,2,3]
3
strings = ["a","b"]
4
emptyArray = []
Copied!
Formula
Return value
ZIP(numbers, numbers2)
[[100,1],[3,2],[20,3]]
ZIP(numbers, strings)
[[100,"a"],[3,"b"]]
ZIP(numbers, emptyArray)
[]
Last modified 1yr ago
Export as PDF
Copy link