title: Why use binary shifts in enums
body: <p>I'm looking at this code:</p>
  
  <pre><code>/**
   * Bitmask of states
   */
  export const enum ViewState {
      FirstCheck = 1 &lt;&lt; 0,      // result is 1
      ChecksEnabled = 1 &lt;&lt; 1,   // result is 2
      Errored = 1 &lt;&lt; 2,         // result is 4
      Destroyed = 1 &lt;&lt; 3        // result is 8
  }
  </code></pre>
  
  <p>I don't understand why not simply specify the integer results there or integer numbers <code>0,1,2,3</code>. Does anyone have any idea?</p>