Dynamically create Instance fields for a JavaScript Object
<p>I have a dynamically-created list of strings called 'variables'. I need to use these strings as the instance variables for an array of JavaScript objects.</p>

<pre><code>var objectsArr  = [];
function obj(){};

for (var i=0; i&lt;someNumberOfObjects; i++ ) {
    ...
    objectsArr[i] = new Object();           


    for (var j=0; j&lt;variables.length; j++) {
        objectArr[i].b = 'something';  //&lt;--this works, but...
        //objectArr[i].variables[j] = 'something';  //&lt;---this is what I want to do.
    }       
}
</code></pre>

<p>The commented-out line shows what I am trying to do.</p>
