Is there a way to make a dynamic variable name based on the value of another variable?
<p>Is there a way to make the value of a variable the name for another variable? For example, I want the variable name (<strong>value_of_i</strong>) to be what ever number <strong>"i"</strong> is during that iteration. The while loop below is not what I'm using it for, it's just to explain what I'm asking.</p>

<pre><code>var i = 1;
while(i&lt;10)
{

var value_of_i = "This loop has ran " + i + "times.";

i++;
}
</code></pre>

<p>For the first iteration, "i" is equal to 1 so I would want the variable name to be "1":</p>

<pre><code>var 1 = "This loop has ran " + i + "times.";
</code></pre>

<p>And the second interation:</p>

<pre><code>var 2 = "This loop has ran " + i + "times.";
</code></pre>
