Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as JavaScript by slowmotion ( 6 years ago )
function chunkArrayInGroups(arr, size) {
var smallArr = [];
var bigArr = [];
for(var i=0; i<size; i++){
for(var j=0; j<(arr.length/size); j++){
smallArr.push(arr[j]);
}
bigArr.push(smallArr);
smallArr = []
console.log(smallArr);
}
return arr;
}
chunkArrayInGroups(["a", "b", "c", "d","a1", "b1", "c1", "d1"], 2);
Revise this Paste