Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Created September 18, 2015 14:23
Show Gist options
  • Save ceaksan/ac52d9798996ccdbaf10 to your computer and use it in GitHub Desktop.
Save ceaksan/ac52d9798996ccdbaf10 to your computer and use it in GitHub Desktop.
function chunk(arr, size) {
var temp = [], i = 0;
while (i < arr.length) {
temp.push(arr.slice(i, i += size));
}
return temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment