This is the format of json which I need to parse:
[{
"perAddress": {
"city": "Delhi",
"Street": "saket",
"pin": "101011"
},
"flag": false
}, {
"perAddress": {
"city": "Delhi",
"Street": "malvya",
"pin": "101011"
},
"flag": true,
"alterAddress": {
"city": "bangalore",
"street": "velondore",
"pin": "560103"
}
}];
If the flag is false then the corresponding row will not be highlighted and only
perAddress
will be populated .If the flag is true then the corresponding row will be highlighted with containing
perAddress
and on click on the row thealterAddress
need to populated. How to iterate through the json?
.forEach
method which accepts as argument a callback function. – Alexandru-Ionut Mihai 10 mins ago