Splits the array into subgroups
It is O(n) in complexity.
Type of the items in the array
Type of the key, it must be a base type.
Array to split
The function that gives the key of the group of an item
A map of the items grouped by their extracted key.
Splits the array into subgroups
It is O(n) in complexity.