diff --git a/src/util.js b/src/util.js index 9ae8dc6..7bd52ff 100644 --- a/src/util.js +++ b/src/util.js @@ -1,12 +1,5 @@ export const sortData = (data) => { const sortedData = [...data]; - sortedData.sort((a, b) => { - if (a.cases > b.cases) { - return -1; - } else { - return 1; - } - }); - return sortedData; + return sortedData.sort((a, b) => (a.cases > b.cases ? -1 : 1)); }; \ No newline at end of file