I am having an array that consists the objects with a key, value how can we iterate each object for caste and id.
caste
id
[ Object {
Using jQuery.each():
var array = [ {caste: "Banda", id: 4}, {caste: "Bestha", id: 6} ]; $.each(array, function( key, value ) { console.log('caste: ' + value.caste + ' | id: ' +value.id); } );