Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OrderByDescendingDemo(Orders);
/* Returns
Order ID: 1, Quantity: 41, Order Date: 01 Jan 2018 01:01 AM pst
Order ID: 3, Quantity: 31, Order Date: 03 Mar 2018 03:03 AM pst
Order ID: 2, Quantity: 21, Order Date: 02 Feb 2018 02:02 AM pst
Order ID: 5, Quantity: 21, Order Date: 05 May 2018 05:05 AM pst
Order ID: 4, Quantity: 11, Order Date: 04 Apr 2018 04:04 AM pst
*/
sortByDescendingDemo(orders);
/* Returns
Order ID: 1, Quantity: 40, Order Date: Thu Feb 01 2018 01:01:01 GMT-0500 (Eastern Standard Time)
Order ID: 3, Quantity: 30, Order Date: Tue Apr 03 2018 03:03:03 GMT-0400 (Eastern Daylight Time)
Order ID: 2, Quantity: 20, Order Date: Fri Mar 02 2018 02:02:02 GMT-0500 (Eastern Standard Time)
Order ID: 5, Quantity: 20, Order Date: Tue Jun 05 2018 05:05:05 GMT-0400 (Eastern Daylight Time)
Order ID: 4, Quantity: 10, Order Date: Fri May 04 2018 04:04:04 GMT-0400 (Eastern Daylight Time)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment