Skip to content

Instantly share code, notes, and snippets.

@johnhutchins
Created December 9, 2019 15:23
Show Gist options
  • Save johnhutchins/6ccd41e6e7451ced1d0f514dff97e56a to your computer and use it in GitHub Desktop.
Save johnhutchins/6ccd41e6e7451ced1d0f514dff97e56a to your computer and use it in GitHub Desktop.
take a large array and break into smaller chunks
function splitArrToSmallerChunks(bigArr){
let arrOfArr = []
while(bigArr.length){
arrOfArr.push(bigArr.splice(0,50))
}
return arrOfArr
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment