UNPKG

tuna-jslinq

Version:

Linq methods for JavaScript/TypeScript for working with Arrays

7 lines (6 loc) 291 B
JSLinqHelper.NonEnumerable("Last", function <T>(this: T[], selector?: (item: T, index: number) => boolean): T { const result = this.LastOrDefault(selector); if (result) return result; throw new Error("Tuna-JSLinq: The Last Entry was not found"); });