Divides an array into smaller arrays, where smaller arrays have a max size
array of the smaller arrays
assert([0,1,2,3].divideArray(1) == [[0],[1],[2],[3]]); assert([0,1,2,3].divideArray(2) == [[0,1],[2,3]]); assert([0,1,2,3].divideArray(3) == [[0,1,2],[3]]); assert([0,1,2,3].divideArray(4) == [[0,1,2,3]]);
See Implementation
Divides an array into smaller arrays, where smaller arrays have a max size