title: Branching in javascript
body: <p>consider this code:</p>
  
  <pre><code>if (a) 
      doSomething(a)
  else if (b)
      doSomething(b)
  else
      doSomething(c)
  </code></pre>
  
  <p>I can eqvivalently rewrite this using the javascript logical operators to this:</p>
  
  <pre><code>(a &amp;&amp; doSomething(a) || (!a &amp;&amp; b &amp;&amp; doSomething(b)) || (!a &amp;&amp; !b &amp;&amp; doSomething(c)))
  </code></pre>
  
  <p>I know it's not really readable, but will this somehow be optimizing the previous version ? </p>
  
  <p>Because of the fact that operator <code>&amp;&amp;</code> and <code>||</code> return actual expression value, will there be less comparisons ?</p>