Access Javascript variables dynamically
<p>I know you might think this is a duplicate or a dumb question. But the answers doesn't help me.</p>

<p>Here's my simple problem:</p>

<pre><code>var option1 = "some text";
var option2 = "some text";
var option3 = "some text";
</code></pre>

<p>I want to access the elements "option1, option2, option3" in a for loop:</p>

<pre><code>for(var i = 1; i &lt; 4; i++)
{
    alert(option+i);   
}
</code></pre>

<p>I know that it shouldn't be option+i but I dont know how to solve this.</p>

<p>Thanks for the help in advance.</p>

<p>If you find this to be a duplicate just mark this question. Thanks</p>
