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
This is fairly trivial to do with Array.prototype.reduce:
var arr = [
{ key: 'foo', val: 'bar' },
{ key: 'hello', val: 'world' }
];
var result = arr.reduce(function(map, obj) {
map[obj.key] = obj.val;
return map;
}, {});
console.log(result);
// { foo:'bar', hello:'world' }
Note: Array.prototype.reduce() is IE9+, so if you need to support older browsers you will need to polyfill it.