4 ms·
> Also, Javascript doesn't have a logical xor operator, so trying to do that would potentially reduce readability. I also didn't know about any operator to log
by smlckz 5y ago
> Also, Javascript doesn't have a logical xor operator, so trying to do that would potentially reduce readability.
I also didn't know about any operator to logically xor two boolean variables (thought about (ab)using JavaScript's implicit type conversion mechanisms: `x ^ y`), and then I learnt that `!=` works fine as a logical xor for booleans. Tada!
I don't know how much readability is reduced by this.