title: Split array into chunks of array if it is sequential in javaScript
body: <p>I want to spilt array in chunks of array
  <strong>Input=</strong> [36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,57,58,59,60,61,62]
  <strong>Output</strong>= {[36,37,38,39],[40,41,42,43],[44,45,46,47],[48,49,50,51],[57,58,59,60]}</p>
  <pre><code>If there are no sequential numbers from 52 so it should not take that.
  Can anyone help me out?
  Thanks in advance.
  
  I am currently using this code but in output it is not checking the sequence
  
      ```Array.prototype.chunk = function(n) {
        if (!this.length) {
          return [];
        }
        return [this.slice(0, n)].concat(this.slice(n).chunk(n));
      };
      console.log([36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72].chunk(4));    ```
  This output is what i am currently getting but i want output as i mentioned above.
  Output:
  
  [
    [ 36, 37, 38, 39 ],
    [ 40, 41, 42, 43 ],
    [ 44, 45, 46, 47 ],
    [ 48, 49, 50, 51 ],
    [ 52, 57, 58, 59 ],
    [ 60, 61, 62, 63 ],
    [ 64, 65, 66, 67 ],
    [ 68, 69, 70, 71 ],
    [ 72 ]
  ]
        
  </code></pre>