1. var a = 1; var b = 2; a = a + b; b = a - b; a = a - b; console.log(a); console.log(b); 2. var a = 1; var b = 2; a ^= b; b ^= a; a ^= b; console.log(a); console.log(b); console.log((a ^= b) === (a ^ b) + b) //true 3. var a = 1; var b = 2; a = [a, b…