title: Understanding bitwise operations in javascript
body: <p>I am currently storing data inside an XML doc as binary, 20 digits long, each representing a boolean value. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;matrix&gt; 
  
      &lt;resource type="single"&gt; 
          &lt;map&gt;10001010100011110000&lt;/map&gt; 
          &lt;name&gt;Resource Title&lt;/name&gt; 
          &lt;url&gt;http://www.yoursite.com&lt;/url&gt; 
      &lt;/resource&gt;
  
  &lt;/matrix&gt;
  </code></pre>
  
  <p>I am parsing this with jQuery and am currently using a <code>for</code> loop and <code>charAt()</code> to determine whether to do stuff if the value is == "1".</p>
  
  <pre class="lang-js prettyprint-override"><code>for (var i = 0; i &lt; _mapLength; i++) {
      if (map.charAt(i) == "1") {
          //perform something here
      }
  }
  </code></pre>
  
  <p>This takes place a few times as part of a HUGE loop that has run sort of slow.  Someone told me that I should use bitwise operators to process this and it would run faster.</p>
  
  <h2>My question is either:</h2>
  
  <p><strong>Can someone offer me an example of how I could do this?</strong>  I've tried to read tutorials online and they seem to be flying right over my head.  (FYI: I am planning on creating a Ruby script that will convert my binary 0 &amp; 1's into bits in my XML.)</p>
  
  <p><strong>Or does anyone know of a good, simple</strong> (maybe even dumbed down version) <strong>tutorial or something that could help me grasp these bitwise operator concepts?</strong></p>