JavaScript's quirky weakly-typed ==
operator can easily be shown to be non-transitive as follows:
var a = "16";
var b = 16;
var c = "0x10";
alert(a == b && b == c && a != c); // alerts true
I wonder if there are any similar tricks one can play with roundoff error, Infinity
, or NaN
that could should show ===
to be non-transitive, or if it can be proved to indeed be transitive.
==
isn't transitive because of type coercion.===
doesn't coerce... – Sponge===
does not coerce but I'm not sure that that constitutes a proof. It very well might.... – Goiter===
is transitive. – Sponge