storing a dynamic array of values inside an object looped within a for statement
<p>I am looking to create a set of dynamically created arrays stored inside an object. the outcome would be something similar to this... </p>

<pre><code>object.array0.length = 5, object.array1.length = 4, etc
</code></pre>

<p>the name of the array would be generated from within a for loop based on a numerical value declared elsewhere in the application.</p>

<p>Here is the code that I have...</p>

<pre><code>var obj = {};
var weekNum = 4;


        for(i=0; i &lt; weekNum.length;i++) {
            obj['week'+i] = [];
            obj['week'+i].push(day);

            console.log('days stored in week0: '+obj.week0.length);
        }
</code></pre>

<p>What seems to be happening is that <code>obj['week'+i]</code> doesn't realize that it is an array, and the push command doesn't seem to be enough to make it think so. So as a resulting value of  <code>obj.week0.length</code> is always 1 with the actual value just being replaced each time as opposed to the array being incremented.</p>

<p>Also fyi,
The parameter <code>day</code> in the above code would be passed in from another function representing any chosen day (Mon, Tues, etc)... However, the sequence and the amount of days passed in could differ but will never exceed 5 (m-f).</p>
