title: Grouping consecutive numbers in an array
body: <p>I need to add consecutive numbers to a new array and, if it is not a consecutive number, add only that value to a new array:</p>
  
  <pre><code>old_array = [1, 2, 3, 5, 7, 8, 9, 20, 21, 23, 29]
  </code></pre>
  
  <p>I want to get this result:</p>
  
  <pre><code> new_array = [
    [1,2,3],
    [5],
    [7,8,9]
    [20,21]
    [23],
    [29]
  ]
  </code></pre>
  
  <p>Is there an easier way to do this？</p>