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
1.4m articles
1.4m replys
5 comments
57.0k users