Skip to content

Instantly share code, notes, and snippets.

@metoikos
Created March 25, 2020 11:01
Show Gist options
  • Select an option

  • Save metoikos/86afe747973c07559872d4bba04d1d6f to your computer and use it in GitHub Desktop.

Select an option

Save metoikos/86afe747973c07559872d4bba04d1d6f to your computer and use it in GitHub Desktop.
const chunk = (arr: any, size: number) => Array.from({
length: Math.ceil(arr.length, size)
}, (v: any, i: any) => arr.slice(i * size, i * size + size))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment