|
|
|
|
|
by lmkg
4442 days ago
|
|
I think there are a few cases of non-transitive equalities in JavaScript, specifically around falsey values. Part of it also has to do with whether x is the right-side input or the left-side input, because that changes type coercion rules. Aha, found one: ['0'] == 0
> true
[0] == 0
> true
[0] == ['0']
> false
Transitivity of equality can also never be relied upon when dealing with Floating Point numbers. This is correct and unavoidable behavior, but still surprising to many developers. |
|