I am trying to build a javascript function to get all combinations of size N from an array. lets say I got:
const Xarray = ["19", "21","42","23", "25", "28"];
const n = 4;
combinationsOfN(Xarray, n) =>
[ ["19", "21", "42", "23"],
["19", "21", "42", "25"],
["19", "21", "42", "28"],
["19", "21", "23", "25"],
["19", "21", "23", "28"],
["19", "21", "25", "28"],
…. ]