主题
unzip
js
_.unzip(array)
此方法与 _.zip
类似,不同之处在于它接受分组元素的数组并创建一个数组,将元素重新分组为压缩前的配置。
¥This method is like _.zip
except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip configuration.
新增于
¥Since
1.2.0
参数
¥Arguments
array
(数组):要处理的分组元素数组。¥
array
(Array): The array of grouped elements to process.
返回
¥Returns
(数组):返回新的重新分组元素数组。
¥(Array): Returns the new array of regrouped elements.
示例
¥Example
js
var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
// => [['a', 1, true], ['b', 2, false]]
_.unzip(zipped);
// => [['a', 'b'], [1, 2], [true, false]]