peek() {
        if (this.head === this.tail) {
            return undefined;
        }
        return this.list[this.head];
    }
/**
     * Returns the first item in the list without removing it.
     * @returns {*}
     */
Returns the first item in the list without removing it.
Returns the first item in the list without removing it .
peek() {
        if (this.head === this.tail) {
            return undefined;
        }
        return this.list[this.head];
    }
peek ( ) { if ( this . head === this . tail ) { return undefined ; } return this . list [ this . head ] ; }
Returns the first item in the list without removing it.
Returns the first item in the list without removing it .