title: Why is my reversed linked list returning null value?
body: <p>This is my answer for leetcode number 234, it is practically word for word the same as every js answer i've found. But It says that my reversed slow node has no value, why is that? Im failing to see where the issue lies.</p>
  <pre><code>var isPalindrome = function(head) {
      
      let fast = head;
      let slow = head;
      
      while(fast !== null &amp;&amp; fast.next.next !==null){
          fast = fast.next.next;
          slow = slow.next;
      }
      
      fast = head;
      slow = reverse(slow);
      
      while(slow !== null){
          if(fast.val !== slow.val){
              return false;
          }
          fast = fast.next;
          slow = slow.next;
      }
      
      return true;
      
  };
  
  let reverse = function(head){
      let prev = null;
  
      while(head !== null){
          let temp = head.next;
          head.next = prev;
          prev = head;
          head = temp;
      }
  
      return prev
  }
  </code></pre>