Bitwise XOR operator in Javascript
Javascript
let a = 10; // 1010 in binary let b = 6; // 0110 in binary let result = a ^ b; // 1100 in binary console.log(result); // Output: 12 |
Output
12
Bitwise XOR Operator in Programming
Bitwise XOR Operator is represented by the caret symbol (^). It is used to perform a bitwise XOR operation on the individual bits of two operands. The XOR operator returns 1 if the corresponding bits in the two operands are different, and 0 if they are the same.
Table of Content
- What is Bitwise XOR?
- Bitwise XOR operator:
- Bitwise XOR operator in C:
- Bitwise XOR operator in C++:
- Bitwise XOR operator in Java:
- Bitwise XOR operator in Python:
- Bitwise XOR operator in C#:
- Bitwise XOR operator in Javascript:
- Use Cases of Bitwise XOR Operator:
- Applications of Bitwise XOR Operator in Programming: