Skip to content

Instantly share code, notes, and snippets.

@clooth
Created September 7, 2012 14:33
Show Gist options
  • Select an option

  • Save clooth/3666692 to your computer and use it in GitHub Desktop.

Select an option

Save clooth/3666692 to your computer and use it in GitHub Desktop.
splitArray = (array, chunkSize) ->
result = []
while (array.length)
result.push(array.splice(0, chunkSize))
result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment