I have a JSON element. I need to get the volume of every transaction type . When I try
var data = '{"2015:ATM01": {"volume": "2620000","count": "78"},"2015:PIN_PURCHASE01": {"volume": "5162305","count": "101"},"ALL:PIN_PURCHASE01": {"volume": "5162305","count": "101"},"ALL:DIRECT_DEPOSIT01": {"volume": "32752700","count": "50" }}';
var JSONArray=JSON.parse(data);
for(var k in JSONArray){
console.log("key is is.... "+k);
console.log("voulume is.... "+k.volume);
}
I get volume as undefined . Please help me. Thanks.
Please check this fiddle: http://jsfiddle.net/1qgvs9o9/
You need to retrieve volume like this :