title: Trying to add multiple properties to Javascript object using a loop
body: <p>I hope the day finds you well.</p>
  
  <p>So I have an object with no properties.  I'm trying to add multiple properties to this object using a loop.  Each property added to the loop will appear in the object multiple times depending on how many times the loop runs, with each new property incremented by 1.</p>
  
  <p>So I have something like this:</p>
  
  <pre><code>myObject = {  };
  
  for(i = 0; i &lt; 2; i++){
      myObject.propA + i = foo;
      myObject.propB + i = bar;
  };
  </code></pre>
  
  <p>Which I want to yield something like this:</p>
  
  <pre><code>myObject.propA0 = foo;
  myObject.propB0 = bar;
  myObject.propA1 = foo;
  myObject.propB2 = bar;
  </code></pre>
  
  <p>Giving a nice stack of objects generated on the fly depending on how many times the loop runs.  But I don't seem to be getting this.  So how exactly do I feed the variable from the loop to the property when it's created and assigned?</p>