title: How to find all subsets of a set in JavaScript? (Powerset of array)
body: <p>I need to get all possible subsets of an array.</p>
  <p>Say I have this:</p>
  <pre><code>[1, 2, 3]
  </code></pre>
  <p>How do I get this?</p>
  <pre><code>[], [1], [2], [3], [1, 2], [2, 3], [1, 3], [1, 2, 3]
  </code></pre>
  <p>I am interested in all subsets. For subsets of specific length, refer to the following questions:</p>
  <ul>
  <li>Finding subsets of size n: <a href="https://stackoverflow.com/questions/5752002/find-all-possible-subset-combos-in-an-array">1</a>, <a href="https://stackoverflow.com/questions/37892738/generate-subsets-of-length-n">2</a></li>
  <li>Finding subsets of size &gt; 1: <a href="https://stackoverflow.com/questions/24556889/subsets-of-an-arrays-with-n-elements-javascript">1</a></li>
  </ul>