 <p>Well, this is easy:</p> <pre><code>var DATES=[];for (var i=0;i&lt;mlength;DATES.push([]),i++); </code></pre> <p>Just push an empty array to <code>DATES</code> <code>mlength</code> number of times.</p>