data = [{"map_name": "PHX7260.AE5020003.9"},
{"map_name": "PHX7260.AE5020003.10"},
{"map_name": "PHX7260.AE5020003.1"}]
I want to sort this data in descending order alphabetically and numerically both.
I tried the below but it doesn't work on array of objects.
var myArray = data;
var collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
console.log(myArray.sort(collator.compare));
How should I go about it, the data of objects is received and it should be returned as objects only and not as array to display.