Creating new object instances in a loop
<p>I'm trying to create a new object for each item in an array by looping. The names of the objects should be based on the key of the array. </p>

<p>So for this array:</p>

<pre><code>var arr = new Array(
    "some value",
    "some other value",
    "a third value"
);
</code></pre>

<p>Would result in three objects:</p>

<pre><code>alert(object1.value);
alert(object2.value);
alert(object3.value);
</code></pre>

<p>The code I have thus far (but isn't working) is:</p>

<pre><code>// Object
function fooBar(value) {
    this.value = value;
    ...
}

// Loop
var len = arr.length;
for (var i = 0; i &lt; len; i++) {
    var objectName = object + i;
    var objectName = new fooBar(arr[i]);
}
</code></pre>

<p>Does what I'm asking for even make sense?</p>
