Programmatically setting the name of a variable
<p>Is there a shortcut for writing the following 100 assignments?</p>

<pre><code>variable_1 = 1;
variable_2 = 2;
variable_3 = 3;

...

variable_100 = 100;
</code></pre>

<p>I have tried</p>

<pre><code>for(var i = 1; i &lt;= 100; i++) {
    variable_ + i = i;
}
</code></pre>

<p>but I get the error message "Invalid left-hand side in assignment". Any ideas?</p>
