jquery - scope of function passed to $().grep
<p>It seems that "myFunction" in the following example loses its scope. </p>

<pre><code>$().grep(myArray, myFunction)
</code></pre>

<p>By this, I mean that it no longer has access to the "this" of the scope it was defined in, and "this" becomes the window object. Can anyone explain why this is and if there's a handy way to preserve myFunction's scope? This javascript closure stuff halfway does my head in, but I'm trying to get facile with it.</p>
