Group values according to an indicator function and return group counts.
stdlib.io
stdlib-js/utils-count-by