Split an array into columns in javascript : <p>I want to reduce array so I have its' values in 'columns' where the first value lives in the first column, the second one in the second, etc. until it wraps, so that for example the fourth value is in the first of three columns.</p>

<pre><code>&gt;&gt; [1, 2, 3, 4, 5, 6, 7].in_columns(3)
=&gt; [[1, 4, 7], [2, 5], [3, 6]]
</code></pre>
