I want to do something like this:
var data = [
{
sortData: {a: \'a\', b: 2}
},
{
sortData: {a: \'a\', b: 1}
},
{
sort
Update: See the comments below, this is not a good solution in most cases.
Someone kindly answered in the issue I created. Here's his answer, inlined:
_.sortBy(data, function(item) {
return [item.sortData.a, item.sortData.b];
});
I didn't realize that you're allowed to return an array from that function. The documentation doesn't mention that.