groupBy takes an array of T values, and a selector that prduces
key/value pairs from those inputs, and converts this array into an output
object, with those keys, and where each property is an array of values, in
the case that the same key shows up multiple times in the input.
For instance, given an array as follows
[{ s:"a", n:1 }, { s:"a", n:2 }, { s:"b", n:1 }]
and whose selector is roughly (e) => [e.s, e.n], the resulting object will be
groupBy takes an array of T values, and a selector that prduces key/value pairs from those inputs, and converts this array into an output object, with those keys, and where each property is an array of values, in the case that the same key shows up multiple times in the input.
For instance, given an array as follows
and whose selector is roughly
(e) => [e.s, e.n]
, the resulting object will be