code: function () {
          while (this.head !== null) {
              var temp = this.head;
              this.head = this.head.next();   // use next() the instead of "_next", otherwise it will loop forever
              temp._list = null;
              temp._next = null;
              temp._prev = null;
          }
  
          this.head = null;
          this.size = 0;
      }
docs: Removes all nodes from the LinkedList.