unshift(val) {
        let node = new Node(val);
        if (this.head === null) {
            this.head = node;
            this.tail = node;
        }
        else {
            node.next = this.head;
            this.head.prev = node;
            this.head = node;
        }
    }
// unshift (push value to the head of the list)
unshift (push value to the head of the list)
unshift ( push value to the head of the list )
unshift(val) {
        let node = new Node(val);
        if (this.head === null) {
            this.head = node;
            this.tail = node;
        }
        else {
            node.next = this.head;
            this.head.prev = node;
            this.head = node;
        }
    }
unshift ( val ) { let node = new Node ( val ) ; if ( this . head === null ) { this . head = node ; this . tail = node ; } else { node . next = this . head ; this . head . prev = node ; this . head = node ; } }
unshift (push value to the head of the list)
unshift ( push value to the head of the list )