(obj, value, context, behavior)
| 323 | |
| 324 | // An internal function used for aggregate "group by" operations. |
| 325 | var group = function(obj, value, context, behavior) { |
| 326 | var result = {}; |
| 327 | var iterator = lookupIterator(value == null ? _.identity : value); |
| 328 | each(obj, function(value, index) { |
| 329 | var key = iterator.call(context, value, index, obj); |
| 330 | behavior(result, key, value); |
| 331 | }); |
| 332 | return result; |
| 333 | }; |
| 334 | |
| 335 | // Groups the object's values by a criterion. Pass either a string attribute |
| 336 | // to group by, or a function that returns the criterion. |
no test coverage detected
searching dependent graphs…