Below is an array list that needs to be converted into a specific form.
var data = [ "USA", "Denmark", "London"];
The desired format for the array is:
var data = [
{ "id" : 1, "label": "USA" },
{ "id" : 2, "label": "Denmark" },
{ "id" : 3, "label": "London" }
];
If you have a solution on how to achieve this conversion, please share with me.