How can I store reference to a variable within an array?
<p>I'm trying to create an array that maps strings to variables. It seems that the array stores the current value of the variable instead of storing a reference to the variable.</p>

<pre><code>var name = "foo";
var array = [];

array["reference"] = name;

name = "bar";

// Still returns "foo" when I'd like it to return "bar."
array["reference"];
</code></pre>

<p>Is there a way to make the array refer to the variable?</p>
