divideArray

Divides an array into smaller arrays, where smaller arrays have a max size

T[][]
divideArray
(
T
)

Return Value

Type: T[][]

array of the smaller arrays

Examples

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]]);

Meta