Does anyone know of a (lodash if possible too) way to group an array of objects by an object key then create a new array of objects based on the grouping? For example, I hav
Grouped Array of Object in typescript with this:
groupBy (list: any[], key: string): Map> { let map = new Map(); list.map(val=> { if(!map.has(val[key])){ map.set(val[key],list.filter(data => data[key] == val[key])); } }); return map; });