1const a = 5; // 00000000000000000000000000000101
2const b = 3; // 00000000000000000000000000000011
3// xor operator ^
4console.log(a ^ b); // 00000000000000000000000000000110
5// expected output: 6
1//Javascript xor condition
2if ((a && !b) || (!a && b))
3{
4 // code to be exucuted
5}