lodash multi-column sortBy

There’s a nifty method to sort an array of objects based on several properties:

var data = _.sortBy(array_of_objects, ['type', 'name']);

However that is only for ascending sorting. Is there some handy way of defining direction per column? E.g.

var data = _.sortBy(array_of_objects, [{'type': 'asc'}, {'name': 'de

Leave a Comment