How to add an object whose key is in a variable to an index in an array : <p>I have an array of objects and want to add a new object to it in a for loop. They key of the object is dynamic and inside a variable. How can I do this. My array:</p>

<pre><code>var myKey = "someStringThatIsDynamic";   
var myArray[i].myKey = "myValue";
</code></pre>
