I am trying to display the value of the key from the api response. my code looks like
if(response[0].status == "Success")
{
alert('success');
}
else
{
var texts = "";
for (reasons in response[0].error_reason) {
texts += reasons+";";
}
alert(texts);
}
My key here is "item" and its value is "Choose an valid item" . i want to print the value in alert. BUt when i try to alert its displaying the key(item) not the value. how can i display key value here. also there can be multiple keys like items.
texts += response[0].error_reason[reasons] + ";";.