Groups each item in the array of items into a map according to the keySelector
Array of items to group by
Function to run on each item to get the key for the group to which it belongs
Function to run on each item to get the value it should have in the group (like map function). If not provided, uses the item itself
Map of keys to groups of values corresponding to each item
Groups each item in the array of items into a map according to the keySelector