Using a dynamic variable within a for statement
<p>I would like to dynamically create and reference some variables on the fly, but i'm not understanding how to.</p>

<p>Here is what I would think 'should' work, but I know doesn't.</p>

<pre><code>var weeks = 4;
 for(i=0; i&lt;weeks.length;i++){
  var 'week_'+i = valueFromXML;
}



function wtFn (){
  'week_'+i.splice(-1, 1);
  if('week_'+i.length &lt;=0){
    $(this).parent().parent().slideUp();
  }
}
</code></pre>

<p>I'm open to suggestions. Thanks in advance.</p>
