diff --git a/docs/src/pages/demos/tables/EnhancedTable.js b/docs/src/pages/demos/tables/EnhancedTable.js index eb320694a1110c..5e946706865117 100644 --- a/docs/src/pages/demos/tables/EnhancedTable.js +++ b/docs/src/pages/demos/tables/EnhancedTable.js @@ -26,9 +26,7 @@ function createData(name, calories, fat, carbs, protein) { } function getSorting(order, orderBy) { - return order === 'desc' - ? (a, b) => (b[orderBy] < a[orderBy] ? -1 : 1) - : (a, b) => (a[orderBy] < b[orderBy] ? -1 : 1); + return order === 'desc' ? (a, b) => b[orderBy] - a[orderBy] : (a, b) => a[orderBy] - b[orderBy]; } const columnData = [