unshift(data) {
    let newNode = new Node(data)

    if (!this.head) {
      this.head = newNode
      this.tail = this.head
    } else {
      this.head.prev = newNode
      newNode.next = this.head
      this.head = newNode
    }

    this.length++
    return this
  }
// Add new node in the beginning
Add new node in the beginning
Add new node in the beginning
unshift(data) {
    let newNode = new Node(data)
    if (!this.head) {
      this.head = newNode
      this.tail = this.head
    } else {
      this.head.prev = newNode
      newNode.next = this.head
      this.head = newNode
    }
    this.length++
    return this
  }
unshift ( data ) { let newNode = new Node ( data ) if ( ! this . head ) { this . head = newNode this . tail = this . head } else { this . head . prev = newNode newNode . next = this . head this . head = newNode } this . length ++ return this }
Add new node in the beginning
Add new node in the beginning