Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Sep 16, 2018 2:20 PM
Views: 3
Tags: array chunk js
Javascript - array chunk
  1. function arrayChunk (array, chunk) {
  2.     let i, j, chunkArray;
  3.     for (i = 0, j = array.length; i < j; i += chunk) {
  4.         chunkArray = array.slice(i, i + chunk);
  5.     }
  6.  
  7.     return chunkArray;
  8. }