Sorting bug hiding in here.
const scores = [12, 4, 30, 21];
scores.sort((a, b) => a > b);
console.log(scores);
Reply with what is broken and how you would fix it.
Sorting bug hiding in here.
const scores = [12, 4, 30, 21];
scores.sort((a, b) => a > b);
console.log(scores);
Reply with what is broken and how you would fix it.
The conditional is broken inside the sort function!
:: Copyright KIRUPA 2024 //--