主题
zip
js
_.zip([arrays])
创建一个分组元素数组,其中第一个元素包含给定数组的第一个元素,第二个元素包含给定数组的第二个元素,依此类推。
¥Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
新增于
¥Since
0.1.0
参数
¥Arguments
[arrays]
(...数组):要处理的数组。¥
[arrays]
(...Array): The arrays to process.
返回
¥Returns
(数组):返回新的分组元素数组。
¥(Array): Returns the new array of grouped elements.
示例
¥Example
js
_.zip(['a', 'b'], [1, 2], [true, false]);
// => [['a', 1, true], ['b', 2, false]]