UNPKG

array-grouping-polyfill

Version:

proposal-array-grouping polyfill. Polyfill for array.prototype.groupBy and array.prototype.groupByMap

7 lines (6 loc) 275 B
interface Array<T> { groupBy<K extends (string | symbol)>(callback: (value: T, index: number, array: T[]) => K, thisArg?: any): { [P in K]: T[]; }; groupByToMap<K>(callback: (value: T, index: number, array: T[]) => K, thisArg?: any): Map<K, T[]>; }