toObject takes an array of T values, and a selector that produces
key/value pairs from those inputs, and converts this array into an output
object with those keys and values.
For instance, given an array as follows
[{ s:"a", n:1 }, { s:"b", n:2 }, { s:"c", n:3 }]
and whose selector is roughly (e) => [e.s, e.n], the resulting object will be
toObject takes an array of T values, and a selector that produces key/value pairs from those inputs, and converts this array into an output object with those keys and values.
For instance, given an array as follows
and whose selector is roughly
(e) => [e.s, e.n]
, the resulting object will be