Difference in swapping nodes in Doubly Linked List

While writing reverse method of Doubly Linked List, I observed that node swapping by Method 1 didn’t yield the expected result but Method 2 did.

Method 1

node.prev, node.next = node.next, node.prev;

Method 2

let tempNode = node.next;
node.next = node.prev;
node.prev = tempNode;

So, what is the difference between this swapping methods?

Here’s a link to the challenge

JS isn’t python so doesn’t automatically pack and unpack tuples for you, so your first attempt evaluates to

node.prev;
node.next = node.next;
node.prev;

I think what you meant to do was:

[node.prev, node.next] = [node.next, node.prev];