get-combos

Get all possible combinations / permutations of an array of items.

Usage no npm install needed!

<script type="module">
  import getCombos from 'https://cdn.skypack.dev/get-combos';
</script>

README

NPM Version CI codecov Dev Dependency Status

Get Combinations

Get all possible combinations / permutations of an array of items.

Table of Contents

Installation

npm install get-combos --save

Usage

import { combinations } from 'get-combos';

const result = combinations(['A', 'B']);

console.log(result);
// => [
//  ['A', 'A'],
//  ['A', 'B'],
//  ['B', 'A'],
//  ['B', 'B'],
// ]

Development

npm install
npm run build