I have a json file that is requested from a server so i can't modify how is sent, i want to order those objects by a property that is really nested (for example the average property that is located in localidades)
estados(array of objects)
localidades (array of objects)
type2 (object) etc..
i only know how to order a simple array of objects in lodash, but not this type of complex object, any hints/suggestions?
here is a json sample :
The data does not have an 'average' or even 'avg' field. Here is an example, based on averaging the 'promedio' field for each estado.
What I did is use the _.sortBy with a more advanced predicate.