title: Javascript if statement and && operator not working when using twice same variable
body: <p>In the following code, it looks if the time is below 8:30 AM. It's working fine (tested when time was 2:26 AM):</p>
  
  <pre><code>function workingSchedule() {
      var h = new Date().getHours();
      var m = new Date().getMinutes();
      if (h &lt; 8 &amp;&amp; m &lt; 30) {
          window.alert("Sorry, we're not working at these hours.");
      }
  }
  </code></pre>
  
  <p>However, if I want the code to check if 1) it's earlier than 8:30AM; 2) it's later than 12:00 midday, it won't work.</p>
  
  <pre><code>function workingSchedule() {
      var h = new Date().getHours();
      var m = new Date().getMinutes();
      if ((h &lt; 8 &amp;&amp; m &lt; 30) &amp;&amp; h &gt; 12) {
          window.alert("Sorry, we're not working at these hours.");
      }
  }
  </code></pre>
  
  <p>Basically, I have a working schedule from 8:30 AM to 12:00, and from 2:00 PM to 5:00 PM. I want to display the alert window text "<em>Sorry, we're not working at these hours</em>" whenever the time of the machine (computer, laptop, cellphone) is <strong>not</strong> between these hours.</p>
  
  <p>Is it a problem with <code>&amp;&amp;</code> operators, or with <code>if</code> statement, or both?</p>