I am trying to create a loop that will select the 'Photos' from each element in the array. However, they have no index numbers so I can't use a traditional for loop, using the loop iteration to select the next object each time. I can't seem to find a method that allows the selector to change each time the loop occurs.
This is what I have:
function fetchHalls() {
halls = [];
fetch(`https://www.data.brisbane.qld.gov.au/data/dataset/d14761ac-9bd9-4712-aefd-4bace8ca7148/resource/d7a4821d-eb68-454a-9615-356e17fd805b/download/bcccommunityhalls.json`)
.then(resp => resp.json())
.then(data => {
halls = halls.concat(data);
console.log(halls[0].Halls[ 'Acacia Ridge Hall' ].Description[4].Photos);
});
}
I basically want to change 'Acacia Ridge Hall', to the next hall name in the array and do that for as many halls are in the array. Which I also tried but '.length' returned nothing.
