Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // number the user wants to purge
- const num = 90;
- // how many loops its going to take
- const numOfRuns = Math.ceil(num / 100);
- // looping
- for(i = 0; i < numOfRuns; i++) {
- // if we are on the last iteration and the number is not a multiple of 100
- if(i === numOfRuns - 1 && num % 100 !== 0) {
- // bulkDelete(num % 100) here
- } else {
- // bulk delete 100 here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement