Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.96 KB

combo.md

File metadata and controls

49 lines (39 loc) · 1.96 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


combo(array, [length]) ⇒ Array

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]]