push(item) {
        if (item === undefined) {
            return this.size();
        }
        const tail = this.tail;
        this.list[tail] = item;
        this.tail = (tail + 1) & this.capacityMask;
        if (this.tail === this.head) {
            this.growArray();
        }
        if (this.head < this.tail) {
            return this.tail - this.head;
        }
        else {
            return this.capacityMask + 1 - (this.head - this.tail);
        }
    }
/**
     * Add an item to the bottom of the list.
     * @param item
     */
Add an item to the bottom of the list.
@param item
Add an item to the bottom of the list . @param item
push(item) {
        if (item === undefined) {
            return this.size();
        }
        const tail = this.tail;
        this.list[tail] = item;
        this.tail = (tail + 1) & this.capacityMask;
        if (this.tail === this.head) {
            this.growArray();
        }
        if (this.head < this.tail) {
            return this.tail - this.head;
        }
        else {
            return this.capacityMask + 1 - (this.head - this.tail);
        }
    }
push ( item ) { if ( item === undefined ) { return this . size ( ) ; } const tail = this . tail ; this . list [ tail ] = item ; this . tail = ( tail + 1 ) & this . capacityMask ; if ( this . tail === this . head ) { this . growArray ( ) ; } if ( this . head < this . tail ) { return this . tail - this . head ; } else { return this . capacityMask + 1 - ( this . head - this . tail ) ; } }
Add an item to the bottom of the list.
Add an item to the bottom of the list .