A javascript library for working with objects
Takes an array of values and returns a new array of the unique sets of the values of a given length.
Param | Type | Default | Description |
---|---|---|---|
array | Array |
The array of values. | |
[length] | length |
2 |
The length of returned sets. |
Example
import { combo } from 'object-agent';
combo([1, 2, 3]);
// => [[1, 2], [1, 3], [2, 3]]
combo([1, 2, 3, 4], 3);
// => [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]