title: Itertools.combinations in Javascript
body: <p>Is there a similar library as Python's itertools in JavaScript? I'm interested in permutations and combinations especially.</p>
  
  <p>I'm not using Node.js.</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>array = ['a', 'b', 'c', 'd'];
  
  //return non-duplicate combinations of length 2
  ['a', 'b']
  ['a', 'c']
  ['a', 'd']
  ['b', 'c']
  ['b', 'd']
  ['c', 'd']
  </code></pre>
  
  <p>Thanks! :)</p>