chunk([1, 2, 3, 4, 5], 2) // β [[1, 2], [3, 4], [5]]chunk<T> splits an array into sub-arrays of a fixed size, preserving the element type.
Challenge: Implement chunk<T>(arr: T[], size: number): T[][] splitting arr into subarrays of size.
chunk([1,2,3,4], 2) // β [[1,2],[3,4]]
chunk([1,2,3,4,5], 2) // β [[1,2],[3,4],[5]]