Feature Request: Add option for ASC/DESC
Easy enough, but just adding a third function argument for sort direction.
You can use the reverse option. This is the same as sorting in descending order. See the usage example to see if this is what you're looking for.
Closing this... you can use reverse to get the array sorted in descending order.
Sorry, Missed this before. didn't realize it was reverse until you told me and guess I never responded and thanked you.
too used to SQL...
Thanks.
I hope you can change the syntax to direction: 'asc' and direction: 'desc', because lots of people are more used to this IMO!
I agree with @doowb but also see the value of having asc/desc. I think we should consider adding those.
I'll try to work on this sometime along with #9. I think there are concepts that we can look at to make this easier to do.
You can try this arr-sort.
Sort an object array by one or more properties even nested properties. Besides, you can determine the direction even supply a comparison function in each property sorting.