enqueue(task) {
    const newNode = {
      value: task
    };

    if (this.tail) {
      this.tail.next = newNode;
      newNode.prev = this.tail;
    } else {
      this.head = newNode;
    }

    this.tail = newNode;
  }
/**
   * Puts new task at the end of the list
   * @param task Task to add to the queue
   */
Puts new task at the end of the list
@param task Task to add to the queue
Puts new task at the end of the list @param task Task to add to the queue
enqueue(task) {
    const newNode = {
      value: task
    };
    if (this.tail) {
      this.tail.next = newNode;
      newNode.prev = this.tail;
    } else {
      this.head = newNode;
    }
    this.tail = newNode;
  }
enqueue ( task ) { const newNode = { value : task } ; if ( this . tail ) { this . tail . next = newNode ; newNode . prev = this . tail ; } else { this . head = newNode ; } this . tail = newNode ; }
Puts new task at the end of the list
 @param task Task to add to the queue
Puts new task at the end of the list @param task Task to add to the queue