On Jan 15, 2011, at 5:27 PM, Michael Haufe (TNO) wrote:

> #1 - function(){ WScript.Echo("foo") }();
> #2 - (function(){ WScript.Echo("foo") }());
> #3 - (function(){ WScript.Echo("foo") })();
> 
> #1 is an error. #2 and #3 both work.



Maybe he suggests #2 exactly because #1 is an error... that way you don't 
forget to wrap the whole thing...

I find #3 clearer as well but influenced by JSLint I started using #2.. 
nowadays I don't care about JSLint that much, I still use it to check for 
errors but I don't try to make my code fit all the rules anymore.. the benefits 
of using some of them are very subjective..

if it causes more problems than it solves, don't use it.

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to