This commit is contained in:
3
src/collection/sortedBy.ts
Normal file
3
src/collection/sortedBy.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function sortedBy<T>(value: T[], transform: (it: T) => number): T[] {
|
||||
return [...value].sort((a, b) => transform(a) - transform(b));
|
||||
}
|
||||
Reference in New Issue
Block a user