Closed
Description
Would it be possible to add a map()
-like function (since changing the current one would break things) which works exactly like map()
but returns an object instead of an array if an object was passed?
Example:
_.map2({abc: 123, xyz: '6', foo: '9'}, function(num, key) {
return parseInt(num, 10);
});
=> {abc: 123, xyz: 6, foo: 9}
It might also make sense to have it return [key, value]
tuples but just modifying the values might be sufficient for many cases.