Is it preferable to use "this" or "that" (where var that = this)?
<p>I'm fairly new to JavaScript and I'm cleaning up some JavaScript code I downloaded. One of the inconsistencies in this code is mixed usage of both <code>this</code> and the local variable <code>that</code> that references it.</p>

<p>An example code snippet (private method within a jQuery UI widget):</p>

<pre><code>_populateLists: function(options) {
    //do stuff with this

    var that = this;
    options.each(function(index) {
        //use both this AND that, they are different in this scope
    });

    //here this and that are the same thing
    //I want to be consistent, is one preferable over the other?
},
</code></pre>

<p>In many places throughout the code, where the scope is such that <code>this === that</code>,  there is mixed usage, even within the same line of code.</p>

<p>For the sake of readability and maintainability, is it preferable to use <code>this</code> or <code>that</code>?</p>

<p>Note: I realize a lot of these types of things depend on developer preference. But before I decide to rewrite the code to use one over the other, I'd like to understand any reasoning if/why one would be preferred over the other.</p>

<p><strong>EDIT:</strong> In this script, I think the <em>only</em> reason <code>this</code> is being assigned to a local variable is so that it can be referred to from within the inner closure.</p>
