Zips multiple arrays by index, pairing the elements at each position.
The result length is determined by the shortest input array; elements of
longer arrays beyond that length are ignored. The input arrays are not
mutated.
按索引将多个数组配对组合。
结果长度由最短的输入数组决定,较长数组中超出该长度的元素会被忽略。不会修改输入数组。
Parameters
...arrays: readonlyunknown[][]
The arrays to zip. 要配对的数组
Returns unknown[][]
An array of tuples, each containing the elements at the same index. 元组数组,每个元组包含同一索引位置的元素
Remarks
Unlike lodash / es-toolkit (which pad with undefined to the longest
length), the result is truncated to the shortest array.
Zips multiple arrays by index, pairing the elements at each position.
The result length is determined by the shortest input array; elements of longer arrays beyond that length are ignored. The input arrays are not mutated.
按索引将多个数组配对组合。
结果长度由最短的输入数组决定,较长数组中超出该长度的元素会被忽略。不会修改输入数组。