code: function cancelJob(id){
    let curJob = queue.peek();
    if(curJob && id === curJob.id){ // to avoid queue.peek() is null
      queue.pop();
      delete map[id];
  
      clearTimeout(timer);
      excuteJob();
    }
    delete map[id];
    return true;
  }
docs: Cancel Job