Why does jQuery have undefined in its argument signature, and why does it pass window in again?
<p>I see jQuery is wrapped with...</p>

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

<p><a href="http://code.jquery.com/jquery-latest.js" rel="nofollow">Source</a>.</p>

<p>I see it passes in <code>window</code> again (my guess to make accessing it faster), but why is <code>undefined</code> there, and it is not passed in the self invoking function?</p>

<p>My guess is to protect jQuery from some bozo doing...</p>

<pre><code>var undefined = 'defined';
</code></pre>

<p><a href="http://jsfiddle.net/alexdickson/3TqWL/" rel="nofollow">In that instance</a>, <code>undefined</code> will be the string <code>'defined'</code>, and that is bad.</p>

<p>If I'm right (always a first :P), then it is a clever way of ensuring that <code>undefined</code> is <em>always</em> really <code>undefined</code>.</p>

<p>Am I right? Can anyone elaborate? Does passing <code>window</code> again indeed make things faster?</p>

<p>Thanks.</p>
