1 function sliceArr(array, size) { 2 var result = []; 3 for (var x = 0; x < Math.ceil(array.length / size); x++) { 4 var start = x * size; 5 var end = start + size; 6 result.push(array.slice(start, end)); 7 } 8 return result; 9 }