shift() {
        const head = this.head;
        if (head === this.tail) {
            return undefined;
        }
        const item = this.list[head];
        this.list[head] = undefined;
        this.head = (head + 1) & this.capacityMask;
        if (head < 2 && this.tail > 10000 && this.tail <= this.list.length >>> 2) {
            this.shrinkArray();
        }
        return item;
    }
/**
     * Remove and return the first item on the list,
     * Returns undefined if the list is empty.
     * @returns {*}
     */
Remove and return the first item on the list,
Returns undefined if the list is empty.
Remove and return the first item on the list Returns undefined if the list is empty .
shift() {
        const head = this.head;
        if (head === this.tail) {
            return undefined;
        }
        const item = this.list[head];
        this.list[head] = undefined;
        this.head = (head + 1) & this.capacityMask;
        if (head < 2 && this.tail > 10000 && this.tail <= this.list.length >>> 2) {
            this.shrinkArray();
        }
        return item;
    }
shift ( ) { const head = this . head ; if ( head === this . tail ) { return undefined ; } const item = this . list [ head ] ; this . list [ head ] = undefined ; this . head = ( head + 1 ) & this . capacityMask ; if ( head < 2 && this . tail > 10000 && this . tail <= this . list . length >>> 2 ) { this . shrinkArray ( ) ; } return item ; }
Remove and return the first item on the list,
 Returns undefined if the list is empty.
Remove and return the first item on the list Returns undefined if the list is empty .