Skip to content

Instantly share code, notes, and snippets.

@lucatsf
Last active July 6, 2022 16:29
Show Gist options
  • Save lucatsf/1c4c466e600ef5c382220f34808cd41b to your computer and use it in GitHub Desktop.
Save lucatsf/1c4c466e600ef5c382220f34808cd41b to your computer and use it in GitHub Desktop.
Create chunk in javascript
const chunkSize = 10;
for (let i = 0; i < dataLoad.length; i += chunkSize) {
const chunk = dataLoad.slice(i, i + chunkSize);
//exemplo a baixo
await request.post('/data-load', dataLoad)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment