3 ms·
Huh? http://codepad.org/aWPtQRMt http://codepad.org/aWPtQRMt
by eurleif 14y ago
Huh? http://codepad.org/aWPtQRMt http://codepad.org/aWPtQRMt
- Turing_Machine 14y ago"==" implies that one can be substituted for the other at will without changing the result. In C, that's not the case for 2 and 2.0. Compilers have gotten a lot better about warning about these situations, but they're far from perfect. In any case, "produces a compiler warning" and "doesn't produce a compiler warning" isn't "==" behavior. We won't even go into why having a logical comparison return an integer result is questionable. Yes, it's very convenient sometimes, but it's still an example of the type of "flaw" that he doesn't like in Javascript.
- deleted 14y ago[deleted]
- Turing_Machine 14y agoHere's an example of it causing problems with no warning of any kind: http://codepad.org/vnYtqRBM http://codepad.org/vnYtqRBM Note that this is precisely why Javascript has ===, widely regarded as one of its "flaws".
- deleted 14y ago[deleted]