I have an object from osm search. And, the tags are like below.
a: {
tg: [
["leisure", "stadium"],
["name", "AA Stadium"],
["key", "game"],
]
}
b: {
tg: [
["key", "game"],
]
}
c: {
tg: [
["name", "GTA"],
["key", "game"],
]
}
Some do not have the name. Therefore, first, I want to check if name exits and then if it exists, returns the index of its array in order to get the name. I can get the name value with the index, but I am stuck at getting index number of the array that contains the name.
How can I get the index of the array that contains name value in this case?