Created
December 9, 2019 15:23
-
-
Save johnhutchins/6ccd41e6e7451ced1d0f514dff97e56a to your computer and use it in GitHub Desktop.
take a large array and break into smaller chunks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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