If I have a nested array as follows:
var attendees={attendees :[{name: John},{name: Terry}]}
how do I loop through the names using the forEach function? I have tried:
attendees.forEach(function(attendees){
console.log(attendees.name):
});
but it does not loop through the subarrays and just gives me:
[{name: John},{name: Terry}]
Appreciate the help!
attendees.attendees.forEach. The first is an object with a propertyattendeeswhich is an array.