title: How to pass a linked-list?
body: <p>I was given this as a solution to delete all duplicate numbers in a Linkded list. But I don't understand how to pass in the linked list?</p>
  <pre><code>var deleteDuplicates = function(head) {
      // sets current node to be head of list
      let current = head
      // runs until we are at the end of the list
      while (current !== null &amp;&amp; current.next !== null) { 
          // checks to see if the current value and the next value are the same
          if (current.val === current.next.val){  
              // skips over the duplicate and the next value becomes 2x next
              current.next = current.next.next            
              // current value and the next value are not the same
          } else {  
              // moves to the next node on the list to run through the while again
              current = current.next 
          }
      
      }
      // returns the linked list with no duplicates
      return head  
  };
  </code></pre>