doc: create sortData variable to sort data
This commit is contained in:
1 parent
d26d40b9be
commit
409b3e1479
1 file changed
+11
+11
@@ -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;
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user