title: Group array values that are in the same range of multiples of 10
body: <p>I have an array, for example:</p>
  
  <pre><code>var arr = [2,4,7,11,25,608,65,109,99,100,504,606,607];
  </code></pre>
  
  <p>I need to make it so each value that is within range of its multiple of ten below and and multiple of ten above it is grouped together.</p>
  
  <p>For example, 2,4,7 are between 0 and 10 so they must be together.
  11 would be alone in its group, like 25,65 etc.
  606,607,608 would be together.</p>
  
  <p>The array above should become:</p>
  
  <p><code>[ [2,4,7],[11],[25],[65],[99],[101],[504],[100,109],[606,607,608] ]</code></p>
  
  <p>I've been thinking about it for a couple of hours and I wasn't able to come up with anything yet. It's really bad not much worth mentioning but so far I'm playing with Math.round (<a href="http://jsfiddle.net/40napnyx/2/" rel="nofollow">http://jsfiddle.net/40napnyx/2/</a>)</p>
  
  <p>Edit:
  I'd like to add another issue (although I will not pick the correct answer based on this if the actual answers don't include the solution of this new problem).</p>
  
  <p>The array may contain values with letters. Those values should all be in the same group, in alphabetical order (only the first letter is taken to determine the order). This group should be the last value in the resulting array.</p>
  
  <p>So for instance 
  <code>var arr = [2, 4, 11,'a3', 25, 7, 'j', 'bzy4];</code></p>
  
  <p>Would be <code>[[2,4,7],[11],[25],['a3','bzy4', 'j']]</code></p>