let a = 1;
let b = 2;
[a, b] = [b, a];
Nice, didn't realise one could easily use this to swap variables!
I should probably tell people not to look at comments before trying 😄
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.