What scope when using $.when in jquery
<p>I'm pretty new at this web stuff and I have some calls to the server that look like this</p>

<pre><code>$.when.apply($, serverRequests).then(function () {
    // update the UI on the page
    // remove overlay
});
</code></pre>

<p>So my update the UI on the page part works.  But what I want to do is add an overlay while the server requests are happening.  So I tried adding a method to my serverRequests array with unshift hoping that this would add the overlay, so I later could remove it in the //remove overlay portion.  </p>

<pre><code>        var addOverlay = function () {
            console.log("--------------");
            console.log(this);
            console.log(_this);
        };
        serverRequests.unshift(addOverlay);
</code></pre>

<p>In my attempt to try to add an overlay with _this.$el.find("#mypage"), I was running into issues.  So I tried logging things to the screen.  In the above addOverlay() function, I get nothing printed to the screen.  But if I do this:</p>

<pre><code>var addOverlay = console.log("hello world");
serverRequests.unshift(addOverlay);
</code></pre>

<p>This does work.  What's the difference here?  Thanks in advance!</p>
