3 ms·
> As long as conversion between representations is well-defined and not hugely surprising, what does it matter? In Javascript: let a = '0'; a == !a; /
by pdpi 4y ago
> As long as conversion between representations is well-defined and not hugely surprising, what does it matter?
In Javascript:
let a = '0';
a == !a; // True. Why?
let b = !a;
(a == b) == (!a == !b) // False. Why?
None of the coercions involved is particularly surprising, but the result most definitely is.