4.2.0 • Published 1 year ago

just-cartesian-product v4.2.0

Weekly downloads
7
License
MIT
Repository
github
Last release
1 year ago

just-cartesian-product

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-cartesian-product
yarn add just-cartesian-product

Takes an input of an array of arrays and returns their Cartesian product.

import cartesianProduct from 'just-cartesian-product';

cartesianProduct([[1, 2], ['a', 'b']]); // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
cartesianProduct([[1, 2], ['a', 'b', 'c']]); // [[1, 'a'], [1, 'b'], [1, 'c'], [2, 'a'], [2, 'b'], [2, 'c']]
cartesianProduct([]); // []
cartesianProduct(); // throws
4.2.0

1 year ago

4.1.0

2 years ago

4.1.1

2 years ago

4.0.1

2 years ago

4.0.0

3 years ago

4.0.2

2 years ago

3.1.1

3 years ago

3.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago