title: get intersection between two ranges in javascript
body: <p>I'm trying to find the intersection between two ranges (of int values) and (if exists) return an array containing the start and the end of the intersection</p>
  
  <p>example</p>
  
  <pre><code>range 1 : 2,5
  range 2 : 4,7
  
  result : 4,5
  </code></pre>
  
  <p>I found several other topics regarding intersections between arrays but no one helped me in finding the exact intersection 
  (I just found an useful function that returns a 'true' if the intersection exists but doesn't tell what the intersection is)</p>
  
  <p>I'm very bad at alghoritms so i'm finding some issues and i would really appreciate an hint </p>
  
  <p>Thanks</p>