I am having an array that consists the objects with a key, value how can we iterate each object for caste and id.
[
Object {
In plain JavaScript you can do this:
var array = [{caste: "Banda", id: 4}, {caste: "Bestha", id:6}];
array.forEach(function(element, index) {
console.log(element.id+" "+element.caste);
});
The callback function is called with a third parameter, the array being traversed. For learn more!
So, you don't need to load jQuery library.
Greetings.