Can't figure out how to sort this kind of structure:
[
0: { text: 'Lorem', 'children': [ 0: { text: 'Ipsum of Lorem' } ... ] }
...
]
I can only sort by the first level like this: _.sortBy(myArray,'text')
I need something like _.sortBy(myArray, ['text','children.text']) this obviously doesn't work.
I need to sort by children.text of each item.