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
Parameters
Section titled “Parameters”any[]
any type of data
int
the number of objects in each group (without replacement)
Returns
Section titled “Returns”any[][]
array of combinations
Example
Section titled “Example”combinations([1, 2, 3], 2); // => [[1,2], [1,3], [2,3]]