Counts the values of an array into a map, with the key being based on a key mapper, and the value being the occurrences of the key mapper result in the initial array.
12.0.0
Count map.
countMapBy([1, 2, 4, 2, 4, 4], val => val)// => Map{1: 1, 2: 2, 4: 3}
Array to count.
Function to use for key generation.
Generated using TypeDoc
Counts the values of an array into a map, with the key being based on a key mapper, and the value being the occurrences of the key mapper result in the initial array.
Since
12.0.0
See
Returns
Count map.
Example