diff --git a/src/util.js b/src/util.js index e69de29..b4b3707 100644 --- a/src/util.js +++ b/src/util.js @@ -0,0 +1,11 @@ +export const sortData = (data) => { + const sortedData = [...data]; + + sortedData.sort((a, b) => { + if (a.cases > b.cases) { + return -1; + } else { + return 1; + } + }); +}; \ No newline at end of file