title: Can I create dynamic object names in JavaScript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4385084/javascript-dynamic-variables">javascript - dynamic variables</a><br>
    <a href="https://stackoverflow.com/questions/7762502/dynamic-javascript-variable-names">Dynamic Javascript variable names</a>  </p>
  </blockquote>
  
  
  
  <p>I need to create a number of objects on a page and want to name them sequentially. Is there a way to do this in JavaScript?</p>
  
  <pre><code>for (i=0;i&lt;num;i++){
    var obj+i = new myObject("param1","param2");
    obj+i.someProperty = value;
  }
  </code></pre>
  
  <p>This way I can dynamically create a varying number of objects (dependent on the value "num") and then set their properties appropriately.</p>
  
  <p>I can do this in PHP, is there a way to do it in JavaScript?</p>