pop() {
        let node = this.tail;
        this.tail = this.tail.prev;
        this.tail.next = null;
        return node.val;
    }
// pops the tail of the list
pops the tail of the list
pops the tail of the list
pop() {
        let node = this.tail;
        this.tail = this.tail.prev;
        this.tail.next = null;
        return node.val;
    }
pop ( ) { let node = this . tail ; this . tail = this . tail . prev ; this . tail . next = null ; return node . val ; }
pops the tail of the list
pops the tail of the list