Creating objects in for loop. I missing the mark a bit
<p>I would like to have a for loop create objects as the children of a parent object. Usually, I would declare the object without using the for loop like this:</p>

<pre><code> var mObj = {};
 mObj.obj1 = {};
 mObj.obj2 = {};
 mObj.obj3 = {};
 mObj.obj3.firstname = "john";
 mObj.obj3.lastname = "superfly";
</code></pre>

<p>Now lets say I would like to employ a for loop to create the children objects of a parent object "mObj".</p>

<p>This is where I am going wrong:</p>

<pre><code>var mArr = ["firstname","lastname","email"]; // This array holds the keys for the   objects

 var mObj = {};

 var len = (mArr.length);

 for(var i=0; i&lt;len; i++){

      var obj+i = {}
      mObj = obj+i;
      mObj.obj + i.mArr[i] = ""

    }
</code></pre>

<p>So the outcome of this would be:</p>

<pre><code> mObj.obj1.firstname = "";
 mObj.obj2.lastname = "";
 mObj.obj3.email = "";
</code></pre>

<p>I just cannot seem to name the object with counter that is being created within for loop like:</p>

<pre><code>obj1
obj2
obj3
</code></pre>

<p>Any help would highly be appreciated.</p>

<p>Thanks.</p>
