Skip to content

Instantly share code, notes, and snippets.

@milafrerichs
Created November 4, 2013 11:17
Show Gist options
  • Save milafrerichs/7301183 to your computer and use it in GitHub Desktop.
Save milafrerichs/7301183 to your computer and use it in GitHub Desktop.
Split array into chunks of arrays changed to coffeescript from http://stackoverflow.com/a/10456644
Array::chunk = (chunkSize) ->
array = this
[].concat.apply [], array.map((elem, i) ->
(if i % chunkSize then [] else [array.slice(i, i + chunkSize)])
)
@milafrerichs
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment