funcifyr.js
function(key) {
        return function group(arr) {
          return arr.reduce(function(obj, item) {
            (obj[item[key]] = obj[item[key]] || []).push(item);
            return obj;
          }, {});
        }
      }
function(key) {
        return function group(arr) {
          return arr.reduce(function(obj, item) {
            (obj[item[key]] = obj[item[key]] || []).push(item);
            return obj;
          }, {});
        }
      }
function ( key ) { return function group ( arr ) { return arr . reduce ( function ( obj , item ) { ( obj [ item [ key ] ] = obj [ item [ key ] ] || [ ] ) . push ( item ) ; return obj ; } , { } ) ; } }
Groups together related prop values from an array of objects.

groupBy :: (a) → (arr) → obj

@param key - A property name used to do the grouping
@returns function
@param arr - An array of objects
@returns An object of key-value pairs grouped by the key
Groups together related prop values from an array of objects .