unshift(item) {
        if (item === undefined) {
            return this.size();
        }
        const len = this.list.length;
        this.head = (this.head - 1 + len) & this.capacityMask;
        this.list[this.head] = item;
        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 at the beginning of the list.
     * @param item
     */
Add an item at the beginning of the list.
@param item
Add an item at the beginning of the list . @param item
unshift(item) {
        if (item === undefined) {
            return this.size();
        }
        const len = this.list.length;
        this.head = (this.head - 1 + len) & this.capacityMask;
        this.list[this.head] = item;
        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);
        }
    }
unshift ( item ) { if ( item === undefined ) { return this . size ( ) ; } const len = this . list . length ; this . head = ( this . head - 1 + len ) & this . capacityMask ; this . list [ this . head ] = item ; 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 at the beginning of the list.
Add an item at the beginning of the list .