How to get to differently named array-items when iterating over the whole array?
for(let item of data) { random = item.capital[0]}`; }
for(let item of data) { random = item.capital[0]}`; }
This is how I usually do it. Every array entry has same data up to certain point, like here in the screenshot. If I were to get to native name, I woudl go:
item.name.nativeNames.fra.common
item.name.nativeNames.fra.common
But "fra" part difeeres for each entry. Sometimes it is "en", or "ita" etc.
When I'm iterating, if I don't specify it won't know how to get to that "common" name, and will throw error. My question is how do I do that? xD
Thanks in advance!
P.S. I know you don;t like screen shots but I don;t know how else to get the data. Sorry for that