remove(taskNode) {
    if (taskNode === this.head) {
      this.head = taskNode.next;

      if (this.head) {
        this.head.prev = undefined;
      } else {
        // if we don't have head, we also don't have tail
        this.tail = undefined;
      }
    } else {
      if (taskNode === this.tail) {
        this.tail = taskNode.prev;
      } else {
        // if node is not the tail then it will have .next
        taskNode.next.prev = taskNode.prev;
      } // if node is not the head then it will have .prev


      taskNode.prev.next = taskNode.next;
    }
  }
/**
   * Remove a task node from the queue
   * @param taskNode Queue's node to remove
   */
Remove a task node from the queue
@param taskNode Queue's node to remove
Remove a task node from the queue @param taskNode Queue ' s node to remove
remove(taskNode) {
    if (taskNode === this.head) {
      this.head = taskNode.next;
      if (this.head) {
        this.head.prev = undefined;
      } else {
        this.tail = undefined;
      }
    } else {
      if (taskNode === this.tail) {
        this.tail = taskNode.prev;
      } else {
        taskNode.next.prev = taskNode.prev;
      } 
      taskNode.prev.next = taskNode.next;
    }
  }
remove ( taskNode ) { if ( taskNode === this . head ) { this . head = taskNode . next ; if ( this . head ) { this . head . prev = undefined ; } else { this . tail = undefined ; } } else { if ( taskNode === this . tail ) { this . tail = taskNode . prev ; } else { taskNode . next . prev = taskNode . prev ; } taskNode . prev . next = taskNode . next ; } }
Remove a task node from the queue
 @param taskNode Queue's node to remove
Remove a task node from the queue @param taskNode Queue ' s node to remove
// if we don't have head, we also don't have tail // if node is not the tail then it will have .next // if node is not the head then it will have .prev