MCPcopy
hub / github.com/ternjs/tern / group

Function group

doc/demo/underscore.js:325–333  ·  view source on GitHub ↗
(obj, value, context, behavior)

Source from the content-addressed store, hash-verified

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.

Callers 1

underscore.jsFile · 0.85

Calls 2

lookupIteratorFunction · 0.85
eachFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…