I have an object that looks like this:
var unsorted = {a: 15, b: 1,c: 2, d: 4, e: 3, f: 6, g: 1}
And I am interested in sorted it in descending order with lodash, so the expected result should be:
var sortd = {b: 1, g: 1,c: 2, e: 3, d: 4, f: 6, a: 15}
I have tried using lodash orderBy
but it gives an array of just the values sorted.
_.orderBy(tempCount, Number, ['desc'])
//Result
[1,1,2,3,4,6,15]