function sortByDescendingDemo(orders) { | |
// Switching o1 & o2 around has the same effect as sorting in descending order | |
var oderedOrders = orders.sort((o1, o2) => o2.quantity - o1.quantity); | |
printOrders(oderedOrders); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment