(obj, value, context, behavior)
| 15996 | |
| 15997 | // An internal function used for aggregate "group by" operations. |
| 15998 | var group = function(obj, value, context, behavior) { |
| 15999 | var result = {}; |
| 16000 | var iterator = lookupIterator(value || _.identity); |
| 16001 | each(obj, function(value, index) { |
| 16002 | var key = iterator.call(context, value, index, obj); |
| 16003 | behavior(result, key, value); |
| 16004 | }); |
| 16005 | return result; |
| 16006 | }; |
| 16007 | |
| 16008 | // Groups the object's values by a criterion. Pass either a string attribute |
| 16009 | // to group by, or a function that returns the criterion. |
no test coverage detected