| 759 | // Returns the results of applying the `iteratee` to each element of `obj`. |
| 760 | // In contrast to `_.map` it returns an object. |
| 761 | function mapObject(obj, iteratee, context) { |
| 762 | iteratee = cb(iteratee, context); |
| 763 | var _keys = keys(obj), |
| 764 | length = _keys.length, |
| 765 | results = {}; |
| 766 | for (var index = 0; index < length; index++) { |
| 767 | var currentKey = _keys[index]; |
| 768 | results[currentKey] = iteratee(obj[currentKey], currentKey, obj); |
| 769 | } |
| 770 | return results; |
| 771 | } |
| 772 | |
| 773 | // Predicate-generating function. Often useful outside of Underscore. |
| 774 | function noop(){} |