I am trying to create 2 loops that work one after each other. I am basically trying to get all the fruits from the array. I have tried doing a for loop inside a for loop but that only gives me the first fruit from each object not every single fruit in the array.
var customers = [{
"Name" : "John",
"Items" :[
{"Fruits" : "Apple"},{"Fruits" : "Orange"}]
},{
"Name" : "Sam",
"Items" :[
{"Fruits" : "Pear"},{"Fruits" : "Nuts"}]
},{
"Name" : "Eric",
"Items" :[
{"Fruits" : "Banana"},{"Fruits" : "Raisins"}]
}];
for(i=0; i<=customers.length; i++){
for(a=0; a<=customers.length; a++){
alert(customers[i]["Items"][a]);
}
}