For example I've array generated with the loop like this.
var array=[];
for(var i=1; i<=30; i++)
{
array.push(i);
}
console.log(array);
I want to output the combination of all the possible group of 7 numbers from the array. For example a sample output may look like : [1,5,14,4,30,23,19]. If I would to calculate the possible combination with the combination formula. It would be something like this: n!/r!(n-r)!
And it is going to be a huge number. I've found a permutation solution here, but what it does is that it prints out all the possible numbers according to the length of array. But my need is to find out the possible combination of 7 numbers from total 30 integers.
How would I solve this problem logically and practically with javascript.