Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // number the user wants to purge
  2.  
  3. const num = 90;
  4.  
  5. // how many loops its going to take
  6.  
  7. const numOfRuns = Math.ceil(num / 100);
  8.  
  9. // looping
  10.  
  11. for(i = 0; i < numOfRuns; i++) {
  12.  
  13. // if we are on the last iteration and the number is not a multiple of 100
  14.  
  15. if(i === numOfRuns - 1 && num % 100 !== 0) {
  16.  
  17.  
  18. // bulkDelete(num % 100) here
  19.  
  20. } else {
  21.  
  22.  
  23. // bulk delete 100 here
  24.  
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement