Implement a function chunk(array, size) that splits an array into multiple smaller arrays of the specified size.
Example
chunk([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]] chunk([1, 2, 3, 4, 5, 6], 3); // [[1, 2, 3], [4, 5, 6]] chunk([1, 2, 3], 1); // [[1], [2], [3]]
JavaScript Function
No test results yet
Click "Run" to execute tests