Closed mobergmann closed 9 months ago
Apparently sorting the users doesn't work:
I had a peek at the source code and apparently the sorting function is broken. To be specific, the lines
let lhs_sum = lhs.activities.reduce((a, b) => a.amount + b.amount, 0); let rhs_sum = rhs.activities.reduce((a, b) => a.amount + b.amount, 0);
return NaN and the comparison of NaN values is not utile when sorting.
NaN
Apparently sorting the users doesn't work:![image](https://github.com/mobergmann/sport-challenge/assets/23003549/7ed3b2bd-5904-4cad-a1de-9f0ac0f91127)
I had a peek at the source code and apparently the sorting function is broken. To be specific, the lines
return
NaN
and the comparison ofNaN
values is not utile when sorting.