title: Can't use dynamic array name with JQuery
body: <p>I am trying to iterate thru arrays to get country info for a dropdown.</p>
  
  <p>These are the arrays:</p>
  
  <pre><code>var array_states_US = new Array("AL", "AK", "AR")
  var array_states_names_US = new Array("Alabama", "Alaska", "Arkansas")
  
  var array_states_MX = new Array("AG", "BN", "BS")
  var array_states_names_MX = new Array("Aguascalientes", "Baja California", "Baja California Sur")
  </code></pre>
  
  <p>Here is the function:</p>
  
  <pre><code>function buildDropdown(countryISO){
      var tmpArry = 'array_states_'  + countryISO;
      var tmpArryNames = 'array_states_names_' + countryISO;
      $(tmpArry).each(function(i) {
                  $(stateSelectId).append($("&lt;option&gt;&lt;/option&gt;").attr("value", this).text($(tmpArryNames)[i]));
      });
  }
  </code></pre>
  
  <p>But JQuery sees $(tmpArry) and $(tmpArryNames) as strings instead of the array values. (When I used MooTools in a past project for this, the dynamic var was not a problem.) If i use $(array_states_MX) and $(array_states_names_MX) instead, then it works. But the countryISO value has to be dynamic.</p>
  
  <p>What is the correct syntax to make this work?</p>