---
# System prepended metadata

title: \#207 Reverse Linked List
tags: [leetcode, leetcode-easy]

---

# \#207 Reverse Linked List
## *倒轉Linked List*
## Log
 - build 20210430 by syhuang

## 初見
 - 標準倒轉Linked List作法
```javascript=
var reverseList = function(head) {
    if(!head || !head.next) return head;
    var prevNode = null;
    var currNode = head;
    while(currNode){
        var nextNode = currNode.next;
        currNode.next = prevNode;
        prevNode = currNode;
        currNode = nextNode;
    }
    return prevNode;
};
```
## 備註
## 參考
 - [參考解(含標準與遞迴兩種方式)](https://leetcode.com/problems/reverse-linked-list/discuss/58291/JavaScript-solution-(both-iterative-and-recursive))
###### tags: `leetcode`, `leetcode-easy`