array-combinator

0.0.2 • Public • Published

array-combinator

Generate combinations of array elements. Given an array of array of elements generates combinations of each element of each array.

Install

Install as an NPM package

npm i array-combinator --save

Usage

const combinator = require("array-combinator");
 
combinator( [[1, 2], ['a', 'b', 'c']] );
// outputs
/*
[
  [ 1, 'a' ],
  [ 2, 'a' ],
  [ 1, 'b' ],
  [ 2, 'b' ],
  [ 1, 'c' ],
  [ 2, 'c' ]
]
*/

Tests

Run npm test

Package Sidebar

Install

npm i array-combinator

Weekly Downloads

647

Version

0.0.2

License

MIT

Unpacked Size

7.2 kB

Total Files

6

Last publish

Collaborators

  • ramalho.vfc