Skip to content

combinations

combinations(x, k): any[][]

Defined in: src/combinations.js:12

Implementation of Combinations Combinations are unique subsets of a collection - in this case, k x from a collection at a time. https://en.wikipedia.org/wiki/Combination

any[]

any type of data

int

the number of objects in each group (without replacement)

any[][]

array of combinations

combinations([1, 2, 3], 2); // => [[1,2], [1,3], [2,3]]