Numification is important if you output to another language, for instance, with JSON, where the other language will care about a string showing up where a number should have been.
List interpolation is occasionally necessary for syntax reasons, though I don't think of that as an operator, but the composition of its parts.
!! is for if you don't really love the loosey-goosey nature of Perl, and want to have a function that really, truly returns a boolean, and doesn't just return something that may or may not be a value that is either falsy or not. If you think in OO you may not want people coming to depend on the exact falsy value returned, which may expose internals. Generally I just go with the general Perl/scripting language approach, except when I know I'm leaking internals that I really, really don't want people to couple to.
jerf|10 years ago
List interpolation is occasionally necessary for syntax reasons, though I don't think of that as an operator, but the composition of its parts.
!! is for if you don't really love the loosey-goosey nature of Perl, and want to have a function that really, truly returns a boolean, and doesn't just return something that may or may not be a value that is either falsy or not. If you think in OO you may not want people coming to depend on the exact falsy value returned, which may expose internals. Generally I just go with the general Perl/scripting language approach, except when I know I'm leaking internals that I really, really don't want people to couple to.
The rest are mostly for show.
xlm1717|10 years ago
+"123234" +"1e29" +"abc" // -> NaN
dozzie|10 years ago
yati|10 years ago
dozzie|10 years ago