Created
June 29, 2016 00:13
-
-
Save alchermd/55a15538d7797bf835bc84c9fbd28fab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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