2

Reading http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html made me to ask myself how is the module declaration in the article:

(function () {
    // ... 
}());

different to what I would do in this case:

(function () {
    // ... 
})();

Both are executed immediately, have access to globals...

Nik Terentyev
  • 2,270
  • 3
  • 16
  • 23

1 Answers1

2

They're equivalent. JSLint on default settings would make you prefer the former.

alex
  • 479,566
  • 201
  • 878
  • 984