ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## unzipWith + [link](./unzipWith "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6955 "View in source.") + [npm](https://www.npmjs.com/package/lodash.unzipwith "See the npm package.") ``` _.unzipWith(array, [iteratee=_.identity]) ``` 这个方法类似 `_.unzip`,除了它接受一个 iteratee 来决定如何重组解包后的数组。iteratee 会传入4个参数:(accumulator, value, index, group)。每组的第一个元素作为初始化的值 ### 参数 1. array (Array) 需要解包的已打包数组 2. [iteratee=_.identity] (Function) 决定如何重组解包后的元素 ### 返回值 (Array) 返回一个解包后的数组 ### 示例 ``` var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100], [2, 20, 200]] _.unzipWith(zipped, _.add); // => [3, 30, 300] ```