Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let i =5000, softViolator = false;
- while(i--){
- function getWhatiswanted(tCell, callback) {
- DB.ref('instructors').orderByChild('id').once('value',
- function(snap){
- snap.forEach(function (child){
- let checkCourse = child.val().coursesTaught;
- if(checkCourse.includes(course)){
- let checkConst = child.val().noTeachAt;
- for(key in checkConst){
- if(checkConst[key].includes(tCell.time))
- {
- // the console successfully shows this message
- // when the conditions are true
- console.log('softViolator must be true');
- softViolator = true;
- callback(true);
- return;
- }
- }
- }
- });
- });
- }
- getWhatiswanted(tCell, function (check){
- if(check) softViolator = true;
- });
- if(softViolator) continue;
- console.log(softViolator) // displays false
- //More Code here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement