source: frontend/node_modules/underscore/amd/_group.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 483 bytes
Line 
1define(['./_cb', './each'], function (_cb, each) {
2
3 // An internal function used for aggregate "group by" operations.
4 function group(behavior, partition) {
5 return function(obj, iteratee, context) {
6 var result = partition ? [[], []] : {};
7 iteratee = _cb(iteratee, context);
8 each(obj, function(value, index) {
9 var key = iteratee(value, index, obj);
10 behavior(result, value, key);
11 });
12 return result;
13 };
14 }
15
16 return group;
17
18});
Note: See TracBrowser for help on using the repository browser.