title: Logical AND (&&) and OR (||) operators
body: <p>Logical AND (<code>&amp;&amp;</code>) and OR (<code>||</code>) operators --- who knew they could trick us like this :)</p>
  
  <p>Their definition, for JS (according to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators" rel="nofollow">this</a> explanation), is the following:</p>
  
  <blockquote>
    <p>expr1 <strong>&amp;&amp;</strong> expr2 => Returns expr1 if it can be converted to false;
    otherwise, returns expr2. Thus, when used with Boolean values, &amp;&amp;
    returns true if both operands are true; otherwise, returns false.</p>
    
    <p>expr1 <strong>||</strong> expr2 => Returns expr1 if it can be converted to true;
    otherwise, returns expr2. Thus, when used with Boolean values, ||
    returns true if either operand is true; if both are false, returns
    false.</p>
  </blockquote>
  
  <p>Testing it, indeed it works just as the definition, but here's the problem:</p>
  
  <pre><code>false || ""  //returns ""
  "" || false  //returns false
  </code></pre>
  
  <p>So, obviously:</p>
  
  <pre><code>(false || "") ==  ("" || false) // true
  </code></pre>
  
  <p>But, sadly</p>
  
  <pre><code>(false || "") === ("" || false) // false
  </code></pre>
  
  <p>To the main two questions: </p>
  
  <ol>
  <li>Is this a bug, or why is JavaScript forcing us to use <code>==</code> operator <strong><em>or</em></strong>
  to pay attention to the order when using <code>&amp;&amp;</code> and <code>||</code> operators?</li>
  <li>Why is javascript unable to convert expr1 to <code>true</code> in this expression
  <code>("" || false)</code>?. I mean, isn't it as simple as prepending <code>""</code> with the
  NOT (<code>!</code>) operator?</li>
  </ol>