javascript passing variable to a function inside a function
<p>I have a problem getting the value of 'name' displayed with the following:</p>

<pre><code>   for (var name in array) {
        var hoverIn = function() {
                  alert(name);
        };

        var hoverOut = function() {
        };

        thing.hover(hoverIn, hoverOut);

   }
</code></pre>

<p>What I get is an alert window with the last value of name. Clearly I am doing something wrong and I suspect it's a simple fix. Can anyone help?</p>

<p>Thanks.</p>
