title: How to dynamically create variable name?
body: <p>I need to create javascript objects that base on user defined number. So if user defines 20, then I need to create 20 variables.</p>
  
  <pre><code>var interval_1=0, interval_2=0, interval_3=0, interval_4=0, interval_5=0... interval_20=0;
  </code></pre>
  
  <p>how do I do it so the name of the object can be dynamically created?</p>
  
  <pre><code>for (i=0; i&lt;=interval; i++){
      var interval_ + i.toString() = i;
  }
  </code></pre>