Skip to content

Instantly share code, notes, and snippets.

@wmakeev
Created December 28, 2014 05:47
Show Gist options
  • Save wmakeev/63c750692588759c0ff6 to your computer and use it in GitHub Desktop.
Save wmakeev/63c750692588759c0ff6 to your computer and use it in GitHub Desktop.
Split the array into parts
var codeGroups = [];
for (var i = 0, len = productCodes.length; i < len; i += groupSize) {
codeGroups.push(_.first(_.last(productCodes, len - i), groupSize));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment