There are data structure without indexes:
const data = [{
"B": {
"value": 1,
},
"D": {
"value": "45"
},
"E": {
"value": "234"
},
"A": {
"value": "543"
},
"C": {
"value": "250"
}
}, {
"B": {
"value": 6,
},
"D": {
"value": "234"
},
"E": {
"value": "67"
},
"A": {
"value": "78"
},
"C": {
"value": "12"
}
}
]
and array of strings by which data array above should be sorted:
const strings = ["E", "C", "B", "A", "D"];
Is there a solution to sort data array by strings in order to get final result like:
[{
"E": {
"value": "234",
},
"C": {
"value": "45"
},
"B": {
"value": 1
},
"A": {
"value": "543"
},
"D": {
"value": "250"
}
}...