printList() {
    const arr = [];
    let currentNode = this.head;
    // while loops are handy when we don't know the length of iterable
    while (currentNode) {
      arr.push(currentNode.value);
      currentNode = currentNode.next;
    }
    console.log(arr);
  }
/**
   * conosle logs the values in each node in the list as an array
   *
   * @memberof LinkedList
   */
conosle logs the values in each node in the list as an array
@memberof LinkedList
conosle logs the values in each node in the list as an array @memberof LinkedList
printList() {
    const arr = [];
    let currentNode = this.head;
    while (currentNode) {
      arr.push(currentNode.value);
      currentNode = currentNode.next;
    }
    console.log(arr);
  }
printList ( ) { const arr = [ ] ; let currentNode = this . head ; while ( currentNode ) { arr . push ( currentNode . value ) ; currentNode = currentNode . next ; } console . log ( arr ) ; }
conosle logs the values in each node in the list as an array
 @memberof LinkedList
conosle logs the values in each node in the list as an array @memberof LinkedList
// while loops are handy when we don't know the length of iterable