Sha256: 3f5f7bcf5b6a5323cf05f7be564417b3bf500b1f828e5beb5a4d0027040dd21e
Contents?: true
Size: 662 Bytes
Versions: 69
Compression:
Stored size: 662 Bytes
Contents
var max = require('./max'); var map = require('./map'); function getLength(arr) { return arr == null ? 0 : arr.length; } /** * Merges together the values of each of the arrays with the values at the * corresponding position. */ function zip(arr){ var len = arr ? max(map(arguments, getLength)) : 0, results = [], i = -1; while (++i < len) { // jshint loopfunc: true results.push(map(arguments, function(item) { return item == null ? undefined : item[i]; })); } return results; } module.exports = zip;
Version data entries
69 entries across 69 versions & 2 rubygems