When should I use the syntax "(function() {...})();"?
<p>My query is used in cases that "(function() {...})();" Given that I am not a plugin. 
For example "http://piecesofrakesh.blogspot.com/2009/03/downloading-javascript-files-in.html" </p>

<pre><code>(function() {        
  var s = [
    "/javascripts/script1.js",
    "/javascripts/script2.js"
  ];

  var sc = "script", tp = "text/javascript", sa = "setAttribute", doc = document, ua = window.navigator.userAgent;

  for(var i=0, l=s.length; i&lt;l; ++i) {
    if(ua.indexOf("MSIE")!==-1 || ua.indexOf("WebKit")!==-1) {
      doc.writeln("&lt;" + sc + " type=\"" + tp + "\" src=\"" + s[i] + 
          "\" defer&gt;&lt;/" + sc + "&gt;");
    } else {
      var t=doc.createElement(sc);
      t[sa]("src", s[i]);
      t[sa]("type", tp);
      doc.getElementsByTagName("head")[0].appendChild(t);
    }
  }
})();
</code></pre>

<p>Or</p>

<pre><code>var s = [
    "/javascripts/script1.js",
    "/javascripts/script2.js"
];
...
</code></pre>

<p>Thank you.</p>
