group

source

group<K, V>(items: Iterable<V>, keyFn: Function): MultiMapsource

Group a collection of items by applying a key function to produce a MultiMap of keys to items.

If the key function for a given item returns undefined, that item is discarded.