title: Javascript Boolean Operator Confusion
body: <p>I have a few lines of javascript code as below: </p>
  
  <pre><code>var str = '////';
  var re = /^\/+$/g 
  console.log(str &amp;&amp; re.test(str), str &amp;&amp; !re.test(str)); 
  </code></pre>
  
  <p>The output of the code in <code>Node.js</code> are <code>false, false</code> and in <code>Chrome</code> Client side are <code>true, true</code> </p>
  
  <p>I'm quite confused and would anyone help to understand: </p>
  
  <ol>
  <li>Why the two boolean statements are both evaluated to <code>true</code> or <code>false</code> while they are meant to be opposite? </li>
  <li>What's difference between <code>Chrome</code> and <code>Node.js</code> in evaluating the two boolean statements? </li>
  </ol>