The latter has leaks a variable into the global scope.  Generally, this is not 
a good practice.

Raul

On Jun 6, 2014, at 2:56 AM, Sander Elias <[email protected]> wrote:

> Hi aSet...,
> 
> hmmm, an anonymous question on anonymous function, go figure...
> 
> Ok, it is always best practice to use an IIFE (Immediately Invoked Function 
> Expression), even when you are not using angular. 
> There are no practical disadvantages using IFFE's. Well, besides typing a few 
> extra characters. If you are going to
> build a large scale system, they will help you more then you can imagine now. 
> 
> Regards
> Sander
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to