-
Notifications
You must be signed in to change notification settings - Fork 1
zip
Subhajit Sahu edited this page May 9, 2020
·
32 revisions
Combines values from iterables. [:running:] [:vhs:] [:package:] [:moon:]
iterable.zip(xs, [fn], [ths]);
// xs: iterables
// fn: map function (vs, i, xs)
// ths: this argument
const iterable = require('extra-iterable');
var x = [1, 2, 3];
var y = [4, 5, 6];
[...iterable.zip([x, y])];
// [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
[...iterable.zip([x, y], (a, b) => a + b)];
// [ 5, 7, 9 ]
- Data.List.zipWith(): Haskell
- _.zipWith: lodash
- zip: Python
- zip: Ruby
- List-Extra.zip(): elm [:running:]: https://npm.runkit.com/@extra-iterable/zip [:vhs:]: https://asciinema.org/a/RCxPWjxorN8P6RRT55m6odw1B [:package:]: https://www.npmjs.com/package/@extra-iterable/zip [:moon:]: https://www.npmjs.com/package/@extra-iterable/zip.min