I'm having difficulties understanding the swapping of variables. There are many helpful threads explaining how to actually do it, but I am having difficulties understanding it. The example I'm talking about is:
var a = 1;
b = 2;
c = a;
a = b;
b = c;
In my (very basic) understanding I read that in plain english as: the variable c per declaration holds whatever the variable a is pointing at. Since we assign a = b after the declaration, shouldn't the next assignment make b hold the value 2 (because c is pointing at a which we just assigned to b)?