| 782 | // Returns the results of applying the `iteratee` to each element of `obj`. |
| 783 | // In contrast to `_.map` it returns an object. |
| 784 | function mapObject(obj, iteratee, context) { |
| 785 | iteratee = cb(iteratee, context); |
| 786 | var _keys = keys(obj), |
| 787 | length = _keys.length, |
| 788 | results = {}; |
| 789 | for (var index = 0; index < length; index++) { |
| 790 | var currentKey = _keys[index]; |
| 791 | results[currentKey] = iteratee(obj[currentKey], currentKey, obj); |
| 792 | } |
| 793 | return results; |
| 794 | } |
| 795 | |
| 796 | // Predicate-generating function. Often useful outside of Underscore. |
| 797 | function noop(){} |