dequeue() {
    if (this.isEmpty()) {
      throw Error('Empty queue');
    }
    if (this.head_.length == 0) {
      this.head_ = this.tail_;
      this.head_.reverse();
      this.tail_ = [];
    }
    return this.head_.pop();
  }
/**
   * Removes the oldest item from the buffer, which must be non-empty.
   * @return {T} The removed item.
   */
Removes the oldest item from the buffer, which must be non-empty.
@return {T} The removed item.
Removes the oldest item from the buffer which must be non - empty . @return { T } The removed item .
dequeue() {
    if (this.isEmpty()) {
      throw Error('Empty queue');
    }
    if (this.head_.length == 0) {
      this.head_ = this.tail_;
      this.head_.reverse();
      this.tail_ = [];
    }
    return this.head_.pop();
  }
dequeue ( ) { if ( this . isEmpty ( ) ) { throw Error ( 'Empty queue' ) ; } if ( this . head_ . length == 0 ) { this . head_ = this . tail_ ; this . head_ . reverse ( ) ; this . tail_ = [ ] ; } return this . head_ . pop ( ) ; }
Removes the oldest item from the buffer, which must be non-empty.
Removes the oldest item from the buffer which must be non - empty .