SOURCE

const fn = (head) => {
    let curr = head
    let pre = null
    while(curr){
        const next = curr.next
        curr.next = pre
        pre = curr
        curr = next
    }
    return pre
}
console 命令行工具 X clear

                    
>
console