Skip to content

Instantly share code, notes, and snippets.

@Pogix3m
Pogix3m / Array.extension.ts
Last active December 3, 2020 06:05
Group Array By Id in TypeScript
/* tslint:disable */
export {};
type TGroup<T> = {Id: any; Values: T[]};
declare global {
interface Array<T> {
groupBy(aKey: string): TGroup<T>[];
}
}