MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / group

Function group

Three.js/js/leap.js:5887–5895  ·  view source on GitHub ↗
(obj, value, context, behavior)

Source from the content-addressed store, hash-verified

5885
5886 // An internal function used for aggregate "group by" operations.
5887 var group = function(obj, value, context, behavior) {
5888 var result = {};
5889 var iterator = lookupIterator(value || _.identity);
5890 each(obj, function(value, index) {
5891 var key = iterator.call(context, value, index, obj);
5892 behavior(result, key, value);
5893 });
5894 return result;
5895 };
5896
5897 // Groups the object's values by a criterion. Pass either a string attribute
5898 // to group by, or a function that returns the criterion.

Callers 1

leap.jsFile · 0.70

Calls 1

lookupIteratorFunction · 0.85

Tested by

no test coverage detected