2.2.30 • Published 5 years ago

@extra-iterable/product.min v2.2.30

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

Lists cartesian product of iterables. :running: :package: :ledger:

Similar: product, zip. This is part of package extra-iterable.

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

iterable.product(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 = [10, 20, 30];
[...iterable.product([x, y])];
// [
//   [ 1, 10 ], [ 1, 20 ],
//   [ 1, 30 ], [ 2, 10 ],
//   [ 2, 20 ], [ 2, 30 ],
//   [ 3, 10 ], [ 3, 20 ],
//   [ 3, 30 ]
// ]

[...iterable.product([x, y], ([a, b]) => a + b)];
// [
//   11, 21, 31, 12, 22,
//   32, 13, 23, 33
// ]

references

2.2.30

5 years ago

2.2.17

5 years ago

2.2.18

5 years ago

2.2.15

5 years ago

2.2.13

5 years ago

2.2.14

5 years ago

2.2.11

5 years ago

2.2.12

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.19

5 years ago

2.2.28

5 years ago

2.2.29

5 years ago

2.2.26

5 years ago

2.2.27

5 years ago

2.2.24

5 years ago

2.2.25

5 years ago

2.2.22

5 years ago

2.2.23

5 years ago

2.2.20

5 years ago

2.2.21

5 years ago

2.2.7

5 years ago

2.2.8

5 years ago

2.2.6

5 years ago

2.2.5

5 years ago