A function to split an array into smaller chunks (sub-arrays). Usage chunkArray(array, 2) - Returns a new array of chunks (sub-arrays) of size 2.