Immediate function invocation in jQuery library
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2716069/how-does-this-javascript-jquery-syntax-work-function-window-undefined">How does this JavaScript/JQuery Syntax work: (function( window, undefined ) { })(window)?</a>  </p>
</blockquote>



<p>I am trying to breakdown some of the parts of jQuery to better understand what's going on behind the scenes.  For the most part, I am pretty clear on a lot of it's methods, but the first line of code looks like this:</p>

<pre><code>(function( window, undefined ) {
</code></pre>

<p>and the library ends like this</p>

<pre><code>})( window );
</code></pre>

<p>I understand that this is immediate function invocation, but what does this do in context to the jQuery library?  I'm not sure what I am looking at.</p>

<p>Also, where else would this be useful to us?</p>
