Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created May 15, 2019 14:27
Show Gist options
  • Select an option

  • Save BetterProgramming/8a984456bbc290c9620d0d5bb4b94e4f to your computer and use it in GitHub Desktop.

Select an option

Save BetterProgramming/8a984456bbc290c9620d0d5bb4b94e4f to your computer and use it in GitHub Desktop.
export function chunk(arr, size) {
const R = [];
for (var i = 0, len = arr.length; i < len; i += size)
R.push(arr.slice(i, i + size));
return R;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment