I have an array of objects returning from an API call which I need to sort into a specific format.
I\'m trying to organise the destination_country_id alphab
destination_country_id
If your provided array is called list, you can sort it as you want using the following call:
list
list.sort(function (item1, item2) { if (item1.destination_country_name < item2.destination_country_name) { return -1; } return 1; });