Finally someone makes sense of JavaScript's this keyword
I used to always run into trouble when trying to use 'this' inside a closure defined within an object's method.<p>Now, I just put<p><pre><code>    var that = this;
</code></pre>
at the top of very method and use 'that' everywhere in the function.