Iulian Margarintescu
Member since Jul 11, 2012
- Profile: /members/10115-iulian-margarintescu.htm
- URL: http://www.erata.net
- Comments: 2
Recent Blog Comments By Iulian Margarintescu
-
Javascript's Implicit Boolean Conversions
Posted on Jul 12, 2012 at 5:41 AM
@Chris: Thanks for your answer. I understand how string is "not false" in js, but the weird thing is that you would expect something that is "not false" to be "true" :) Also this is a bit surprising: "true" == true => false "true" == false =>... read more »
-
Javascript's Implicit Boolean Conversions
Posted on Jul 11, 2012 at 6:45 AM
Another one that surprised me today: Try this in a JS console: "true" == true ( outputs false !! ) if( "true" ) { return "1"; } else { return "2"; } (outputs "1") if( "true" == true ) { return "1"; } else { return "2&... read more »