Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Latest commit

 

History

History
49 lines (39 loc) · 1.89 KB

combo.md

File metadata and controls

49 lines (39 loc) · 1.89 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


combo(array, [length]) ⇒ array

Takes a set of values and creates an array of the unique sets of the values of a given length.

Param Type Default
array array
[length] length 2

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