JSFiddle - React, Tailwind, and code Playground
by Dmitri Ganenco
JavaScript
var x = [{
"destination_country_id": null,
"primary_cost": "9.50",
"region_id": null,
"destination_country_name": "Everywhere Else",
"name": "xyz",
"place": "abc"
}, {
"destination_country_id": 105,
"primary_cost": "8.00",
"region_id": null,
"destination_country_name": "United Kingdom",
"name": "xyz1",
"place": "abc1"
}, {
"destination_country_id": 209,
"primary_cost": "9.50",
"region_id": null,
"destination_country_name": "United States",
"name": "xyz2",
"place": "abc2"
}, {
"destination_country_id": 123,
"primary_cost": "5.00",
"region_id": null,
"destination_country_name": "Ireland",
"name": "xyz3",
"place": "abc3"
}];
x.forEach(el => {
var nn = Object.keys(el).sort((a,b) => a>b ? 1:-1);
debugger;
});
console.log(x);