exactly, look at JS to see the mess happening, when you have implicit convertions combined with only one operator for addition AND concatenation.
BTW: Ruby's .to_i and .to_f are closer to Perl than JS parseInt() and parseFloat(). Trying to convert a non-numeric string like "abc" in Perl and Ruby produces 0 but in JS it's NaN (not-a-number) a value which doesn't produce a warning!
perl -we' print 4+"abc"' Argument "abc" isn't numeric in addition (+) at -e line 1. 4
Cheers Rolf
In reply to Re^5: Numification of strings
by LanX
in thread Numification of strings
by LanX
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |