0.0.2 • Published 6 years ago

array-combinator v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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