code: function getNextJob(){
    let job = null;
  
    while(!job && queue.size() > 0){
      let id = queue.pop().id;
      job = map[id];
    }
  
    return (!!job)?job:null;
  }
docs: Return and remove the next valid job
  @return Next valid job