Suppose I have two boolean variables and want to know when they are both true or false, in other words, I need a logical equality operator.'
Every JS book suggests bitwise operators, and XOR operator does pretty much the same thing but inverted: it indicates whether boolean variables have different value. So I come up with an expression:
const a = true
const b = false
const c = !(a ^ b)
This code seems quite not obvious when reading. Is there a better and more obvious solution?