title: Javascript Array grouping category
body: <p>I have a problem with grouping an array of numeric value:</p>
  
  <p>I have values in an array like this</p>
  
  <pre><code>var numb = [5,10,11,6,7,18,1,8,2,1,15,12,4,5,3,4,6,7,15,20];
  </code></pre>
  
  <p>that are then sorted into ascending numerical order</p>
  
  <pre><code>var sortedNumb = [1,1,2,3,4,4,5,5,6,6,7,7,8,10,11,12,15,15,18,20];
  </code></pre>
  
  <p>Now I want to create a group of numbers like</p>
  
  <blockquote>
    <p>1-4 , 5-8 , 9-12 , 13-16 , 17-20</p>
  </blockquote>
  
  <p>Is it possible to create groups dynamically, like that?</p>