[Javascript] exists() method

Philip Thompson philthathril at gmail.com
Mon Nov 28 12:32:37 CST 2011


Using ! or !! forces the return to evaluate to a literal true or false.
This is useful when a function is supposed to return a boolean. =D

~Philip


On Wed, Nov 23, 2011 at 7:01 PM, Terry Riegel
<riegel at clearimageonline.com>wrote:

> Very nice, but I do not understand the syntax. What does !! mean? Also your
> original function had a single ! I am not sure what it meant either.
>
> Cryptic syntax like that is challenging to google. Ahhh it is just the NOT
> operator twice.
>
> So if I am reading this correctly the naked parens allow you to execute a
> function and define this for the function? Is that correct. If so is it
> similar to call() or apply()
>
> Thanks,
>
> Terry
>
>
> ---------------------------8<-------------------
> exists=
> /*b.b. Troy III p.a.e.*/
> function(x){try{return!!(0,eval)(x)}catch(e){return!1}}
> --------------------------->8-------------------
>
> The voodoo-chain is now broken, Mr. "x" is free again.
> The host method doesn't have access to our private x
> anymore. And we will not get this x-ray false positive
> leak exception again. The Lab is secure.
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                Troy III
>      progressive art enterprise
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _____________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript
>


-- 
http://lonestarlightandsound.com/


More information about the Javascript mailing list