Array.map want to map a value to nothing
<p>I have the array: <code>[1,2,3,4,5,6,7]</code></p>

<p>I want to achieve: <code>[[1,2], [3,4], [5,6], [7]]</code></p>

<p>I'm thinking Array.map, but it doesn't seem to be able to map to nothing for an element?</p>

<p>I have (using Underscorejs):</p>

<pre><code>arr.map(function(el, idx, arr) {
  if (idx%2 != 0) return null;
  if (idx == arr.length-1) return [el];
  return [el, arr[idx+1]]
}).compact();
</code></pre>

<p>This is still a bit ugly. How can I achieve the transformation (without explicit loop)?</p>