3 ms·
why?
by slim 3y ago
why?
- xigoi 3y agoBecause now the behavior of comparison depends on whether the string looks like a number.
- chx 3y agoArguably 48 == "48" should be true. If this doesn't work for you, stick to ===.
- xigoi 3y agoThank you, I'll stick to languages where you can't just compare numbers and strings without an explicit conversion. Also, should 48 == "48.0" be true? How about "048", "48.", "0x30", " 48 ", "48foo", "3*16", "XLVIII", "forty-eight"?