title: How do I remove the last item of an array inside of an array
body: <p>How do I remove the last item of an array inside of an array. In this case, I want to remove the null at the end of my array inside of an array. Here's my code</p>
  
  <pre><code>function chunkArrayInGroups(arr, size) {
    // Break it up.
    var arrWithSubArr = [];
  
    for(var i = 0; i &lt; arr.length / size; i++){
      arrWithSubArr.push([]);
    }
    var index = 0;
    var whichSubArr = 0;
    for(whichSubArr = 0; whichSubArr &lt; arr.length / size; whichSubArr++){
      for(i = 0; i &lt; size; index++){
        arrWithSubArr[whichSubArr].push(arr[index]);
        i++;
      }
    }
  
    return arrWithSubArr;
  }
  
  chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4);
  </code></pre>