2.2.10 • Published 3 years ago
@extra-lists/zip v2.2.10
Combines matching entries from all lists. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
Similar: cartesianProduct, zip.
This is part of package extra-lists.
lists.zip(xs, [fm], [ft], [vd]);
// xs: n lists
// fm: map function (vs, k)
// ft: till function (dones) (some)
// vd: default value
const lists = require('extra-lists');
const array = require('extra-array');
var x = [['a', 'b', 'c'], [1, 2, 3]];
var y = [['a', 'b'], [10, 20]];
lists.zip([x, y]).map(c => [...c]);
// [ [ 'a', 'b' ], [ [ 1, 10 ], [ 2, 20 ] ] ] (shortest)
lists.zip([x, y], ([a, b]) => a + b).map(c => [...c]);
// [ [ 'a', 'b' ], [ 11, 22 ] ]
lists.zip([x, y], null, array.some).map(c => [...c]);
// [ [ 'a', 'b' ], [ [ 1, 10 ], [ 2, 20 ] ] ] (shortest)
lists.zip([x, y], null, array.every, 0).map(c => [...c]);
// [ [ 'a', 'b', 'c' ], [ [ 1, 10 ], [ 2, 20 ], [ 3, 0 ] ] ] (longest)
References
2.2.10
3 years ago
2.2.9
3 years ago
2.2.8
3 years ago
2.2.7
3 years ago
2.2.5
3 years ago
2.2.4
4 years ago
2.2.3
4 years ago
2.2.2
4 years ago
2.2.0
4 years ago
2.1.3
4 years ago
2.1.6
4 years ago
2.1.5
4 years ago
2.1.8
4 years ago
2.1.7
4 years ago
2.1.2
4 years ago
2.1.1
4 years ago
2.0.89
4 years ago
2.0.91
4 years ago
2.1.0
4 years ago
2.0.90
4 years ago
2.0.88
4 years ago