title: Compare two numeric range in javascript
body: <p>I have two number range.
  Lets say 1st rage is 6-9 and second is 1-15</p>
  
  <p>I need to check that if it is conflicting. I mean if 1-15 is crossing 6-9,
  Valid ranges are
  1-5,
  10-15
  but 1-15, 2-18 like this should return me that it is violating 6-9.</p>
  
  <p>Currently I am checking only signle digit if it falls between range,</p>
  
  <pre><code>if (typeof (Number.prototype.isBetween) === "undefined") {
      Number.prototype.isBetween = function (min, max, notBoundaries) {
          var between = false;
          if (notBoundaries) {
              if ((this &lt; max) &amp;&amp; (this &gt; min)) between = true;
              alert('notBoundaries');
          } else {
              if ((this &lt;= max) &amp;&amp; (this &gt;= min)) between = true;
              alert('Boundaries');
          }
          alert('here');
          return between;
      }
  }
  </code></pre>
  
  <p>But now I need to check range. Any help is appreciated</p>