Here you can find the source of zip(xs, ys, modify)
Array.zip = function(xs, ys, modify) { const result = [];/* w ww. jav a 2 s . c om*/ for(let i = 0; i < Math.min(xs.length, ys.length); i++) { result.push(modify(xs[i], ys[i])); } return result; }
Array.prototype.zip = function() { return this.map((value, index, arr) => { return arr.map((val, idx, array) => { return val[index]; }); }); };
Array.prototype.zip = function (arr, selector) { return this .take(Math.min(this.length, arr.length)) .select(function (t, i) { return selector(t, arr[i]); }); };
Array.prototype.zip = function (callback) { callback = callback || function (data) { return data; return this.map(callback); var arr = [4, 9, 16, 25]; console.log( arr.zip(function (data) { ...
Array.prototype.zip = function (callback) { callback = callback || function (data) { return data; return this.map(callback);
Array.prototype.zip = function(left, right, combinerFunction) { var counter; var results = []; for(counter = 0; counter < Math.min(left.length, right.length); counter++) { results.push(combinerFunction(left[counter],right[counter])); return results; };