Passing a reference to an object into anonymous function
<p>I need to pass a reference to the current object into an anonymous function. In Mootools it would be something like this:</p>

<pre><code>    this.start = function(){

        this.intervalId = setInterval(function(){

            this.elapsedTime ++;
            this.setTime();

        }.bind(this), 1000);
    }
</code></pre>

<p>But I need it to be done using jQuery and such syntax is not supported in jQuery. What can I do? I tried:</p>

<pre><code>    this.start = function(){

        var thisObj = this;
        this.intervalId = setInterval(function(){

            thisObj.elapsedTime ++;
            thisObj.setTime();

        }, 1000);
    }
</code></pre>

<p>But it looks like thisObj is simply a new object because some of its methods which were assigned values in the init method are now empty.</p>

<p>Please advise :)</p>
