Javascript Array zip(arr, selector)
Array.prototype.zip = function (arr, selector) { return this//from ww w . j a va2 s . co m .take(Math.min(this.length, arr.length)) .select(function (t, i) { return selector(t, arr[i]); }); };