title: How would I output all the possible combination of 7 numbers from 30 different numbers in an array in Javascript?
body: <p>For example I've array generated with the loop like this.</p>
  
  <pre><code>var array=[];
  for(var i=1; i&lt;=30; i++)
    {
     array.push(i);
  
    }
   console.log(array);
  </code></pre>
  
  <p>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)!</p>
  
  <p>And it is going to be a huge number. I've found a  <a href="https://stackoverflow.com/questions/9960908/permutations-in-javascript#">permutation solution here</a>, 
  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.</p>
  
  <p>How would I solve this problem logically and practically with javascript.</p>