Skip to content

Instantly share code, notes, and snippets.

@eyy
Created July 3, 2013 15:49
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 eyy/5919637 to your computer and use it in GitHub Desktop.
Save eyy/5919637 to your computer and use it in GitHub Desktop.
slice an array to small ones
exports.eachSlice = function(object, size){
var index = - size,
slices = [];
while ((index += size) < object.length) {
slices.push(object.slice(index, index + size));
}
return slices;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment