title: checking number range using javascript
body: <p>I want to check and validate certain numbers on ranges eg (1 to 6) using Javascript.
  I have tried solutions one and two but cannot get it to work.</p>
  
  <p><strong>solution 1</strong></p>
  
  <pre><code>var num =9;
  if (!in_array(num, 1,6)){
      alert('this number is not within the range);
  } 
  </code></pre>
  
  <p><strong>solution 2</strong></p>
  
  <pre><code>var num =9;
  if (num =&gt;1 &amp;&amp; num &lt;=6){
      alert('this number is okay);
  } else{
      alert('this number is not within the range);
  }
  </code></pre>