[Greasemonkey] screw it... 0.2.7b - with jeremy's checkbox thang

Jeremy Dunck jdunck at gmail.com
Fri Apr 8 14:24:35 EDT 2005


On Apr 8, 2005 1:13 PM, Edward Lee <edilee at gmail.com> wrote:
> (function() {
>   var a = '!';
>   function t(i) {
>     alert('Hello ' + i + a);
>   }
>   setTimeout(function() { t('world') }, 1000);
> })();
> 
> It's kinda
> interesting that with the function wrapper around "t('world')", the
> evaluation is delayed, but it's still able to correctly access the
> function t and variable a.

Huzzah, the magic of closures.  :)


More information about the Greasemonkey mailing list