title: Split array into chunks of N length
body: <p>How to split an array (which has 10 items) into 4 chunks, which contain a maximum of <code>n</code> items.</p>
  
  <pre><code>var a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
  //a function splits it to four arrays.
  console.log(b, c, d, e);
  </code></pre>
  
  <p>And it prints:</p>
  
  <pre><code>['a', 'b', 'c']
  ['d', 'e', 'f']
  ['j', 'h', 'i']
  ['j']
  </code></pre>
  
  <p>The above assumes <code>n = 3</code>, however, the value should be dynamic.</p>
  
  <p>Thanks</p>