Skip to content
Malexion edited this page Oct 31, 2016 · 2 revisions

__.group(obj, [func])

  • obj Item to iterate over.
  • [func] [Optional] Function/String to fetch the path to the item/property being evaluated into groups.

Examples

var groups = __.group([
   { name: 'Frank', income: 60000 },
   { name: 'Sally', income: 100000 },
   { name: 'Bob', income: 0 },
   { name: 'Jeff', income: 0 },
   { name: 'Mya', income: 100000 }
], x => x.income);

console.log(groups);
Clone this wiki locally