Skip to content

Instantly share code, notes, and snippets.

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment