Loop through a JSON Array in JQuery

kgovindarao523-21772
Posted by kgovindarao523-21772 under jQuery category on | Points: 40 | Views : 1216
Hi,

If we have a JSON array, and if we want to loop through that array, following one is the code in jquery.
var items=[{name:'ram',address:'Hyd'},
{name:'bharat',address:'Delhi'},
{name:'krishna',address:'Agra'},
{name:'mahesh',address:'Mumbai'}];

$.each(items, function(key,value) {
console.log(value.name +' lives in '+value.address);
});

Comments or Responses

Login to post response