javascript anonymous function parameter passing
<p>I have some javascript code (within an object) :</p>

<pre><code>toggle: function() {
    var me = this;
    var handler = function() { me.progress() };
    me.intervalId = setInterval(handler, me.intervalTime);
    //...More code
}
</code></pre>

<p>I'm kind of new to javascript, so doing the above as far as I can tell actually passes the <code>me</code> variable into anonymous the function. I was wanting to see if there is a more declarative way to do so? I wanted something along the line of:</p>

<pre><code>var handler = (function(o) { o.progress();})(this));
</code></pre>

<p>but that doesn't seem to be working... Am I missing something? Is this a case where "this is the way the language works so just declare a local variable and deal with it"?</p>

<p><strong>UPDATE:</strong></p>

<p>The source to my problem was/is my unclear understanding of scope and closures in javascript. I found <a href="http://odetocode.com/blogs/scott/archive/2007/07/05/function-apply-and-function-call-in-javascript.aspx" rel="nofollow">this article</a> to help me understand a little more.</p>
