title: javaScript to return a new array of paired values from an array of single values
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8495687/split-array-into-chunks">Split array into chunks</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to convert an array of values into a new array of paired values.</p>
  
  <p>For example i need to convert:</p>
  
  <pre><code>var arr = [1,2,3,4,5,6,7,8];
  </code></pre>
  
  <p>into:</p>
  
  <pre><code>arr = [[1,2], [3,4], [5,6], [7,8]];
  </code></pre>
  
  <p>I tried using jQuery's .map() method like so but this did not work for me:</p>
  
  <pre><code>arr= $.map(arr, function(n, i){
  return [n + ',' + n[ i + 1 ]];
  });
  </code></pre>