I have an object like this coming back as a JSON response from the server:
{\"0\":\"1\",\"1\":\"2\",\"2\":\"3\",\"3\":\"4\"}
I want to conv
var JsonObj = { "0": "1", "1": "2", "2": "3", "3": "4" }; var array = []; for (var i in JsonObj) { if (JsonObj.hasOwnProperty(i) && !isNaN(+i)) { array[+i] = JsonObj[i]; } } console.log(array)
DEMO