I have a collection (Products) and I use _.countBy
like this :
var totalByBrand = _.countBy(result, "Brand");
and I have this result :
{
'Brand 1 ' : 5,
'Brand 2 ' : 45,
'Brand 3 ' : 2,
...
'Brand 99 ' : 25
}
I try to sort this result to obtain that :
{
'Brand 3 ' : 2,
'Brand 1 ' : 5,
'Brand 99 ' : 25,
...
'Brand 2 ' : 45
}
Is it possible with _.sortBy()
?