Community Member Profile
- Profile: /members/7768-Victor.htm
- URL: twitter.com/victoragung
- Comments: 2
- Points: 24
Recent Blog Comments By Victor
-
Javascript's Implicit Boolean Conversions
Posted on Feb 10, 2011 at 7:19 PM
That was just an example I ran into when looking into an application. Personally I would have evaluated it as a bool rather than using comparison. But nevertheless it's weird, I know that non-empty strings should always be true. Which you've shown above. Must be an inconsistency of j... read more »
-
Javascript's Implicit Boolean Conversions
Posted on Feb 9, 2011 at 8:18 PM
Interestingly if you do: true == 2 (or any number besides 0) --> FALSE true == 1 --> TRUE also even more interesting: true == "1" --> TRUE true == "2" (or any other string besides "1") --> FALSE if anyone would care to ex... read more »



