Skip to content

Instantly share code, notes, and snippets.

@dance2die
Last active February 25, 2018 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/66b66906596ca7151778c7628391ceba to your computer and use it in GitHub Desktop.
Save dance2die/66b66906596ca7151778c7628391ceba to your computer and use it in GitHub Desktop.
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