lib/server.js
function chunkArray(myArray, chunk_size){
    var results = [];

    while (myArray.length) {
      results.push(myArray.splice(0, chunk_size));
    }

    return results;
  }
function chunkArray(myArray, chunk_size){
    var results = [];

    while (myArray.length) {
      results.push(myArray.splice(0, chunk_size));
    }

    return results;
  }
function chunkArray ( myArray , chunk_size ) { var results = [ ] ; while ( myArray . length ) { results . push ( myArray . splice ( 0 , chunk_size ) ) ; } return results ; }
Returns an array with arrays of the given size.

@param myArray {Array} Array to split
@param chunkSize {Integer} Size of every group
Returns an array with arrays of the given size .