Count the occurrences of each item in an array based on a transformation function.
This function takes an array and a transformation function that converts each item in the array to a key. It then counts the occurrences of each transformed item and returns an object with the transformed items as keys and the counts as values.
An object containing the transformed items as keys and the counts as values.
Alias