JavaScript Bitwise XOR Operator



Bitwise XOR Operator

^ symbol is used for Bitwise XOR operator.

Bitwise XOR operator takes two values/variables as operands, performs XOR logic gate operation at bit level, and returns their result.

a ^ b
6 ^ 74

Examples

1. Bitwise XOR of values in a, b.

a = 7;
b = 14;
output = a ^ b;
console.log(`${a} ^ ${b} = ${output}`);