2.2.30 • Published 5 years ago

@extra-iterable/zip-shortest.min v2.2.30

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Combines values from iterables, till shortest. :running: :package: :ledger:

Alternatives: zip, zipShortest, zipLongest, zipFirst. This is part of package extra-iterable.

This is browserified, minified version of @extra-iterable/zip-shortest. It is exported as global variable iterable_zipShortest. CDN: unpkg, jsDelivr.

iterable.zipShortest(xs, [vd], [fn], [ths]);
// xs:  iterables
// vd:  default value
// fn:  map function (vs, i, xs)
// ths: this argument
const iterable = require('extra-iterable');

var x = [1, 2, 3];
var y = [4, 5];
[...iterable.zipShortest([x, y])];
// [ [ 1, 4 ], [ 2, 5 ] ]

[...iterable.zipShortest([x, y], 0, ([a, b]) => a + b)];
// [ 5, 7 ]

references

2.2.30

5 years ago

2.2.29

5 years ago

2.2.28

5 years ago

2.2.27

5 years ago

2.2.26

5 years ago

2.2.25

5 years ago

2.2.24

5 years ago

2.2.23

5 years ago

2.2.22

5 years ago

2.2.21

5 years ago