The use case is to convert an array of objects into a hash map based on string or function provided to evaluate and use as the key in the hash map and val
With lodash, this can be done using keyBy:
var arr = [ { key: 'foo', val: 'bar' }, { key: 'hello', val: 'world' } ]; var result = _.keyBy(arr, o => o.key); console.log(result); // Object {foo: Object, hello: Object}