24-swap-nodes-in-pairs

DevGod
 Elf Vtuber
 /** * Definition for singly-linked list. * function ListNode(val, next) { *     this.val = (val===undefined ? 0 : val) *     this.next = (next===undefined ? null : next) * } *//** * @param {ListNode} head * @return {ListNode} */var swapPairs = function(head) {
    let current = head;
    while(current.next){        current = current.next;    }
    return head;};