Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 | 5x 5x 5x | export const sortBy = <Element, Key extends keyof Element>(array: Element[], key: Key): Element[] => {
return array.concat().sort((a: Element, b: Element) => (a[key] > b[key] ? 1 : a[key] < b[key] ? -1 : 0));
};
|