When my application receives a Json string from the server (written in Java), I am faced with an issue when retrieving the data in JavaScript. The current format of the data looks like this:
var data = [{"value":"3","label": "17 hr"},
{"value":"2", "label":"18 hr"},
{"value":"1", "label":"19 hr"}]
}]
What I actually need is:
var data = [{"value": 3, "label": "17 hr"},
{"value": 2, "label": "18 hr"},
{"value": 1, "label": "19 hr"}]
}]
The problem lies in the fact that the values are retrieved as strings instead of integers. How can I modify the retrieval process to get them as integers? What would be the most efficient way to achieve this?