Rookie Javascript question here: I have an object containing arrays like so
const obj = {
'red': [ 'a', 'b', 'c'],
'blue': [ 'a' ],
'green': [ 'a', 'b', 'c', 'd', 'e' ]
}
I want to sort my object so that the properties with the largest arrays come first
obj = {
'green': [ 'a', 'b', 'c', 'd', 'e' ],
'red': [ 'a', 'b', 'c'],
'blue': [ 'a' ]
}
Is there a simple one-liner or lodash method I can achieve this with?