Can I refer to a variable using a string?
<p>Say I have the following JS:</p>

<blockquote>
<pre><code>var foo_index = 123;
var bar_index = 456;
</code></pre>
</blockquote>

<p>And the following HTML:</p>

<blockquote>
<pre><code>&lt;div id="foo"&gt;&lt;/div&gt;
&lt;div id="bar"&gt;&lt;/div&gt;
</code></pre>
</blockquote>

<p>Then I'd like to say this:</p>

<blockquote>
<pre><code>thisIndex = this.id + '_index'
</code></pre>
</blockquote>

<p>And I'd like <code>thisIndex</code> to be a number. How do I turn the string, which is exactly the variable name, into a variable?</p>
