|
|
|
|
|
by pilif
5723 days ago
|
|
personally, I prefer the dynamically typed languages. but I hate. No. HATE PHP's type conversions with its == operator. 0 == 'foobar'
but true == 'foobar' && 0 == false
so true == false ?
eek.Yeah. I know === exists. But if you have to compare strings and numbers, why is the default conversion method you do the lossy one? If you compare a number to a string, why can't you convert the number into a string and compare the two strings? Why convert the string into a number which will be lossy in most cases? |
|
http://stackoverflow.com/questions/359494/javascript-vs
It's not that hard to get your head around, and at least one other major language does it this way.