Javascript create a two dimensional array from one dimensional array using map
<p>I have an array :</p>

<pre><code>var a = [{name : 'foo1'},{name : 'foo2'},{name : 'foo3'},{name : 'foo4'},{name : 'foo5'}]
</code></pre>

<p>How can I output and array from original array like the one below?</p>

<pre><code>[[{name : 'foo1'},{name : 'foo2'}],[{name : 'foo3'},{name : 'foo4'}],[{name : 'foo5'}]]
</code></pre>

<p>using the Array.prototype.map function? thanks.</p>