title: Using switch(true) in javascript for case with number range not working?
body: <p>My goal is to store variable greet with &quot;Good AM&quot; if between midnight and 12PM.
  or &quot;Good Afternoon&quot; if between 12PM and 6PM.
  or &quot;Good evening&quot; if between 6PM and midnight.</p>
  <p>I've attached my code at bottom.
  The problem is, it always return the result of <code>greet = &quot;Good AM&quot;</code>, even though it's not morning/fall in to the range specify in this case.</p>
  <p>I found that there is something wrong with  <code> case (0 &lt; timeNow &lt;= 12)</code> part as
  I have modified my code to replace <code>case (0 &lt; timeNow &lt;= 12)</code> using <code>case(timeNow&lt;=12)</code>
  and it works.
  Does anyone know why this happen?</p>
  <p>p/s: I also noticed warning of 'Unexpected mix of '&lt;' and '&lt;='. (no-mixed-operators)eslint' in my code sandbox.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const timeNow = new Date('8-26-2021 23:15:00').getHours();
  console.log(timeNow);
  
  switch (true) {
    case (0 &lt; timeNow &lt;= 12):
      greet = "Good AM";
      break;
    case timeNow &lt;= 18:
      greet = "Good Afternoon";
      break;
    case timeNow &lt;= 23:
      greet = "Good Evening";
      break;
  
    default:
      greet = "error";
  }
  console.log(greet);</code></pre>
  </div>
  </div>
  </p>