Skip to content
Yasser Moradi edited this page Sep 1, 2015 · 1 revision

Description:

Zip cycles through two sequences using deferred execution. The items at the same index are paired and each pair is transformed by resulSelector. This continues until all of the items in either sequence have been processed. If one sequence has more elements than the other, the extra elements are not projected into the new sequence.

Sample:

let integers1 = [1, 2, 3, 4, 5];
let integers2 = [10, 20, 30, 40, 50, 60];

let zip = integers1.asEnumerable().zip(integers2, (item1, item2) => item1 + item2).toArray();

console.log('zip ....');
for (let index = 0; index < zip.length; index++)
  console.log(zip[index]);
Clone this wiki locally