title: what is wrong with this reverse linklist code?
body: <pre><code> var reverseList = function(head) {
      function reverse(cur,pre){
          if(!cur) return pre
          next = cur.next
          cur.next = pre
          return reverse(next,head)
      }
      return reverse(head.next,head)
  }
  </code></pre>
  <p>I tried a recursion way to write this,</p>
  <p>this code output is not correct <a href="https://leetcode.com/problems/reverse-linked-list/" rel="nofollow noreferrer">running</a>, whats wrong with this code?</p>