3 ms·
PHP is pretty bad, but I think JS really takes the crown for insane equality comparisons. Basically every weird equality comparison from PHP is in JS, along wit
by AnkhMorporkian 12y ago
PHP is pretty bad, but I think JS really takes the crown for insane equality comparisons. Basically every weird equality comparison from PHP is in JS, along with some other humdingers like 0 == [].
And my favorite, '\n\r\t' == 0
- quarterto 12y agoThere is never a good reason to use ==.
- AnkhMorporkian 12y agoI totally agree, but they were bringing up the insane equality rules in PHP using the == operator, so I did likewise in Javascript. Both languages luckily have fantastically logical === operators.