title: How to convert a string value to a variable in javascript?
body: <pre><code>var test1;
  $(document).ready(function () {
      test1 = $("#test1ID").jQueryPlugin();
  });
  
  var test2;
  $(document).ready(function () {
      test2 = $("#test2ID").jQueryPlugin();
  });
  
  ...
  </code></pre>
  
  <p>This is done so we could just do <code>test1.foo()</code>... foo is a function inside the jQueryPlugin that is accessible using <code>test1.foo()</code> syntax;</p>
  
  <p>So we have an array of strings which contains (test1, test2, ...)
  and we need to access foo() while on the loop:</p>
  
  <pre><code>for(i=0; i &lt; theArrayOfStrings.length; i++){
      theArrayOfStrings[i].foo();
      //so here is the problem... we can't do test1.foo(), test2.foo() ... =(
  }
  </code></pre>
  
  <p>Any idea on how to call function foo() while on the loop?
  Or can we convert a string value to a variable in javascript?</p>