Divides an array into smaller arrays of a certain size. Returns an array of these smaller arrays
function chunk<T>(arr: T[], chunkSize: number) T[][]
// Example:
chunk([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2)
//=> [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]