Is there a built in function in jQuery that does the equivalent of http://underscorejs.org/#groupBy ?
Any workarounds?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. jQuery was not made for data handling, but for DOM, Ajax and Animations – those utility functions as
each,maporgrepwhich are needed internally suck.Use Underscore, there is nothing wrong with it! If you don’t want to load the whole script, you can easily copy the
groupbyfunction from the source to wherever you need it. Don’t forget to add a comment on its origin.