Skip to content

Instantly share code, notes, and snippets.

@alchermd
Created June 29, 2016 00:13
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 alchermd/55a15538d7797bf835bc84c9fbd28fab to your computer and use it in GitHub Desktop.
Save alchermd/55a15538d7797bf835bc84c9fbd28fab to your computer and use it in GitHub Desktop.
function chunkArrayInGroups(arr, size) {
var waku = [];
while (arr != []) {
waku.push(arr.splice(0, size));
}
return waku;
}
chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment