xor code example
Example 1: XOR
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
ONLY ONE CAN BE TRUE
Example 2: xor gate
XOR gate
0 0 = 0
1 0 = 1
0 1 = 1
1 1 = 0
Example 3: example use xor in
const findOdd = (xs) => xs.reduce((a, b) => a ^ b);
// this is arrow function