Why is there no logical xor in JavaScript?
Convert values into Boolean form then take bitwise XOR. It will help with non-boolean values as well.
Boolean(a) ^ Boolean(b)