fix: change to one-liner
This commit is contained in:
1 parent
ff97bae9ec
commit
de3c674bb2
1 file changed
+1
-8
+1
-8
@@ -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));
|
||||
};
|
||||
Reference in new issue
Block a user