I have an array of objects (allCities) with a nested array of objects ("Residing City"). How can I loop through and access each "City" key's value?
const allCities = [ { "Residing City": [ { City: "Tokyo", Country: "Japan" }, { City: "London", Country: "UK" }, { City: "Paris", Country: "France" } ], } ]
allCities[0]['Residing City'].forEach((t) => console.log(t.City))
You should read them once. Array Methods
2.1m questions
2.1m answers
60 comments
57.0k users