Is there value in passing a global variable to a function?
<p>I recently saw code that looks like this:</p>

<pre><code>(function (someGlobal) {
    someGlobal.DoSomething();
})(someGlobal);
</code></pre>

<p>where someGlobal was a large framework class.  It could be JQuery.  What is the benefit of doing this?  Is it a good practice?  It seems like this code would be equivalent and less error prone because you don't hide the global:</p>

<pre><code>(function () {
    someGlobal.DoSomething();
})();
</code></pre>
