Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.