title: How to get all subsets of an array?
body: <p>Given an array: <code>[dog, cat, mouse]</code></p>
  
  <p>what is the most elegant way to create:</p>
  
  <pre><code>[,,]
  [,,mouse]
  [,cat,]
  [,cat,mouse]
  [dog,,]
  [dog,,mouse]
  [dog,cat,]
  [dog,cat,mouse]
  </code></pre>
  
  <p>I need this to work for any sized array.</p>
  
  <p>This is essentially a binary counter, where array indices represent bits. This presumably lets me use some bitwise operation to count, but I can't see a nice way of translating this to array indices though.</p>