No need for a temp variable.
Usually, when swapping variables in most programming languages, we need to create some sort of
temp variable in order to 'backup' the value of a variable when changing it with another one.
For example, we usually do something like this.
let a = 1; let b = 2; let temp = a; a = b; b = temp;
let a = 1; let b = 2; [a, b] = [b, a]
There are other methods to swap variables, yet this is probably the only one requiring only a line of code. Let's spare some line of useless information. Not always the shortest solution is the best one, still, in this case we can say it is.
I'll probably write more post like this in the future. I'd rather write shorter posts every week, than writing a long or average size post at random times. Hopefully, this will work out fine.