Create the chunk function that returns an array of elements split into groups the length of the given size.
chunk
If array can't be split evenly, the final chunk will be the remaining elements.