swapping 2 digit number javascript code example
Example: swap numbers in javascript
let a = 1;
let b = 2;
let temp;
temp = a;a = b;b = temp;
a; // => 2
b; // => 1
let a = 1;
let b = 2;
let temp;
temp = a;a = b;b = temp;
a; // => 2
b; // => 1