I have a string like this:
var x = "[{"id": "40", "text": "Budi "}, {"id": "47", "text": "Staff 01"}]"
I expect to loop until end and read the id and text one by one, how to do this in javascript?
I have tried below:
var myArr = JSON.parse(x);
for (var i in myArr) {
alert(myArr[i]);
}