title: Pull array values associated with bitmask
body: <p>I have a simple bitmask, <code>3</code> (<code>"011"</code> in base 2) which denotes that I should extract <code>array[0]</code> and <code>array[1]</code> but not <code>array[2]</code></p>
  
  <p>What is an efficient way to do this?</p>
  
  <p>Ultimately, I'm generating a new array with values that passed a <code>.filter</code></p>
  
  <p>Something like this:</p>
  
  <pre><code>var bitmask = 37, // "100101"
      array = ["a", "b", "c", "d", "e", "f"];
  
  var array2 = array.filter((value, index) =&gt; {
      // do something with bitmask and index to return true
  });
  
  // array2 should be ["a", "c", "f"];
  </code></pre>