Please if this function was to be converted to a “normal” if else statement, how would it look like?
export const orderArr = (arr: any[], key: string) => arr.sort((a, b) => ((a[key] > b[key]) ? 1 : (a[key] === b[key]) ? ((a[key] > b[key]) ? 1 : -1) : -1));
I want to add another condition, but I’m finding it hard to read or digest the current flow.