source: frontend/node_modules/underscore/modules/unzip.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 456 bytes
Line 
1import max from './max.js';
2import getLength from './_getLength.js';
3import pluck from './pluck.js';
4
5// Complement of zip. Unzip accepts an array of arrays and groups
6// each array's elements on shared indices.
7export default function unzip(array) {
8 var length = (array && max(array, getLength).length) || 0;
9 var result = Array(length);
10
11 for (var index = 0; index < length; index++) {
12 result[index] = pluck(array, index);
13 }
14 return result;
15}
Note: See TracBrowser for help on using the repository browser.