print() {
    let printArray = [];

    let current = this.head;

    while (current) {
      printArray.push(current.value);
      current = current.next;
    }

    return printArray;
  }
/**
   * Function to get the values of a linked list
   * @returns {Array} Array of values in the list
   */
Function to get the values of a linked list
@returns {Array} Array of values in the list
Function to get the values of a linked list @returns { Array } Array of values in the list
print() {
    let printArray = [];
    let current = this.head;
    while (current) {
      printArray.push(current.value);
      current = current.next;
    }
    return printArray;
  }
print ( ) { let printArray = [ ] ; let current = this . head ; while ( current ) { printArray . push ( current . value ) ; current = current . next ; } return printArray ; }
Function to get the values of a linked list
 @returns {Array} Array of values in the list
Function to get the values of a linked list @returns { Array } Array of values in the list