Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a two-dimensional array.
Here are some helpful links:
function chunkArrayInGroups(arr, size) {
var start = 0;
var ccc =[];
function mmm(xxx, yyy) {
if ( xxx.length <= start) {
// console.log('yyy ',yyy);
return ccc;
} else {
ccc.push(xxx.slice(start, start + yyy ));
start = start + yyy;
// console.log('www ',ccc);
// console.log(start);
return mmm(xxx, yyy);
}
}
var qqq = mmm(arr, size);
console.log('RETURN => ', qqq);
overlay(JSON.stringify(qqq));
return qqq;
}