Calculate the bitwise XOR of 2 numbers. Meant to be used with Array.prototype.reduce.
number
Array.prototype.reduce
Time complexity: O(1)
Space complexity: O(1)
First operand
Second operand
The bitwise XOR of a and b
a
b
Reducers
const array = [5, 3];array.reduce(Bitwise.xor); // 6 Copy
const array = [5, 3];array.reduce(Bitwise.xor); // 6
Calculate the bitwise XOR of 2 bigints. Meant to be used with Array.prototype.reduce.
bigint
const array = [5n, 3n];array.reduce(Bitwise.xor); // 6n Copy
const array = [5n, 3n];array.reduce(Bitwise.xor); // 6n
Calculate the bitwise XOR of 2
number
s. Meant to be used withArray.prototype.reduce
.Time complexity: O(1)
Space complexity: O(1)