I have the following object
let data = [{
"dia": 1,
"Dic 2019": 40000,
"Nov 2019": 100000,
"Oct 2019": 20000
},{
"dia": 2,
"Dic 2019": 60000,
"Nov 2019": 1000,
"Oct 2019": 200000
}];
How could I organize each object according to its properties from largest to smallest so that the result was
let data = [{
"dia": 1,
"Nov 2019": 100000,
"Dic 2019": 40000,
"Oct 2019": 20000
},{
"dia": 2,
"Oct 2019": 200000
"Dic 2019": 60000,
"Nov 2019": 1000,
}];
I was reviewing some examples and I found the sort function that organizes the objects for me, but in my case I need to organize the properties of each object
I recommend that you change the structure and pass from an object to an array of objects so that you can order, since javascript objects in theory should not be ordered because they do not have a property index, but rather they have a name