Skip to content

Instantly share code, notes, and snippets.

@justingosan
Created July 22, 2015 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justingosan/d8dc8ba1f7c3d298519e to your computer and use it in GitHub Desktop.
Save justingosan/d8dc8ba1f7c3d298519e to your computer and use it in GitHub Desktop.
function chunkify(array, chunk) {
var i, j, temparray;
var chunked = [];
for (i = 0, j = array.length; i < j; i += chunk) {
temparray = array.slice(i, i + chunk);
chunked.push(temparray);
}
return chunked;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment