Combines two iterables by applying a selector to aligned pairs until either source is exhausted.
Element type produced by the first iterable.
Element type produced by the second iterable.
Element type yielded by the selector.
Primary iterable providing the first element of each pair.
Secondary iterable providing the second element of each pair.
Function mapping a pair of elements to the emitted value.
A deferred iterable yielding the selector results for each aligned pair.
Error Rethrows any error thrown by selector.
selector
const result = _zip( [1, 2], ["a", "b"], (value, label) => `${value}${label}`);console.log([...result]); // ["1a", "2b"] Copy
const result = _zip( [1, 2], ["a", "b"], (value, label) => `${value}${label}`);console.log([...result]); // ["1a", "2b"]
or using the curried version:
const result = [ ...pipeInto( [1, 2], zip( ["a", "b"], (value, label) => `${value}${label}` ) ),];console.log(result); // ["1a", "2b"] Copy
const result = [ ...pipeInto( [1, 2], zip( ["a", "b"], (value, label) => `${value}${label}` ) ),];console.log(result); // ["1a", "2b"]
Combines two iterables by applying a selector to aligned pairs until either source is exhausted.