title: concatenate string with integer to use as a variable (creating dynamic variables) in jquery
body: <p>I have an array <code>ARRAY</code> whose length is dynamic. In the below example it is 5 but it may be 10 or 15 also</p>
  
  <pre><code>ARRAY = [A,B,C,D,E];
  var mlength = ARRAY.length;
  Using this mlength, how can I create variables. For example  
  </code></pre>
  
  <p>I want to assign as</p>
  
  <pre><code> mname0=ARRAY[0]; mname1 = ARRAY[1]; mname2= ARRAY[2]; mname3 = ARRAY[3]; mname4 = ARRAY[4];
  </code></pre>
  
  <p>I have tried the below code. But that's creating reference error Invalid left-hand side in assignment</p>
  
  <pre><code> for (var i = 0, mlength = ARRAY.length; i &lt; mlength; i++) {
       'mname'+i = ARRAY[i];
   }
  </code></pre>
  
  <p>How can I create dynamic variables?</p>