title: Javascript usage of && operator instead of if condition
body: <p>What's the point of having this logical operator like this: <code>r == 0 &amp;&amp; (r = i);</code>?</p>
  
  <pre><code>function do()
  {
      var r = 0;
      var i = 10;
      r == 0 &amp;&amp; (r = i);
  }
  </code></pre>
  
  <p>is this the same as:</p>
  
  <pre><code> if (r==0)
   {
       r=i;
   }
  </code></pre>