Question: how xor works in javascript?
Answer: What is Bitwise XOR Operator (^) in JavaScript? It performs a Boolean exclusive OR operation on each bit of its integer arguments. Exclusive OR means that either operand one is true or operand two is true, but not both.