Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. let i =5000, softViolator = false;
  2. while(i--){
  3. function getWhatiswanted(tCell, callback) {
  4. DB.ref('instructors').orderByChild('id').once('value',
  5. function(snap){
  6. snap.forEach(function (child){
  7. let checkCourse = child.val().coursesTaught;
  8. if(checkCourse.includes(course)){
  9. let checkConst = child.val().noTeachAt;
  10. for(key in checkConst){
  11. if(checkConst[key].includes(tCell.time))
  12. {
  13.  
  14. // the console successfully shows this message
  15. // when the conditions are true
  16. console.log('softViolator must be true');
  17.  
  18.  
  19. softViolator = true;
  20. callback(true);
  21. return;
  22. }
  23. }
  24. }
  25. });
  26. });
  27. }
  28.  
  29. getWhatiswanted(tCell, function (check){
  30. if(check) softViolator = true;
  31. });
  32.  
  33. if(softViolator) continue;
  34. console.log(softViolator) // displays false
  35.  
  36. //More Code here
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement