* 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. * * @static * @memberOf _ * @alias unzip * @category Arrays * @para
()
| 40194 | * // => [['fred', 30, true], ['barney', 40, false]] |
| 40195 | */ |
| 40196 | function zip() { |
| 40197 | var array = arguments.length > 1 ? arguments : arguments[0], |
| 40198 | index = -1, |
| 40199 | length = array ? max(pluck(array, 'length')) : 0, |
| 40200 | result = Array(length < 0 ? 0 : length); |
| 40201 | |
| 40202 | while (++index < length) { |
| 40203 | result[index] = pluck(array, index); |
| 40204 | } |
| 40205 | return result; |
| 40206 | } |
| 40207 | |
| 40208 | /** |
| 40209 | * Creates an object composed from arrays of `keys` and `values`. Provide |