Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add option for ASC/DESC #5

Open
SippieCup opened this issue May 17, 2017 · 7 comments
Open

Feature Request: Add option for ASC/DESC #5

SippieCup opened this issue May 17, 2017 · 7 comments

Comments

@SippieCup
Copy link

Easy enough, but just adding a third function argument for sort direction.

@doowb
Copy link
Collaborator

doowb commented May 17, 2017

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.

@doowb
Copy link
Collaborator

doowb commented Sep 11, 2017

Closing this... you can use reverse to get the array sorted in descending order.

@doowb doowb closed this as completed Sep 11, 2017
@SippieCup
Copy link
Author

SippieCup commented Sep 27, 2017

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.

@mesqueeb
Copy link
Contributor

mesqueeb commented Oct 15, 2017

I hope you can change the syntax to direction: 'asc' and direction: 'desc', because lots of people are more used to this IMO!

@jonschlinkert jonschlinkert reopened this Oct 17, 2017
@jonschlinkert
Copy link
Owner

I agree with @doowb but also see the value of having asc/desc. I think we should consider adding those.

@doowb
Copy link
Collaborator

doowb commented Dec 6, 2017

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.

@tywei90
Copy link

tywei90 commented Feb 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants