In Perl, the "!!(value)" idiom normalizes "(value)" as a boolean. Many different values are considered true, and a few different values are considered false, but the result of "!!(value)" can be only one of two values.
So yes, this will make an undef value into a defined false value, but it will also make some random true value into a single predictable true value.
I don't know for sure that it means the same thing in JavaScript, but I'd be pretty surprised if it doesn't.
In reply to Re: Translating JS into Perl
by kyle
in thread Translating JS into Perl
by ron.savage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |