I'm currently looping through an array of waypoints that are returned from the Google Maps API, in the following array I wish to access the values that are labelled Xa and Ya and at the moment I am doing it in this way - [i]["location"]["Xa"], however Xa and Ya are not always the same, sometimes it could be aB and aC or Ya and Za etc. Is there a generic way to access these values?
[
{
"location":{
"Xa":xx.xxxxxxxxxxxxx,
"Ya":xx.xxxxxxxxxxxxx
},
"stopover":true
},
{
"location":{
"Xa":xx.xxxxxxxxxxxxx,
"Ya":xx.xxxxxxxxxxxxx
},
"stopover":true
},
{
"location":{
"Xa":xx.xxxxxxxxxxxxx,
"Ya":xx.xxxxxxxxxxxxx
},
"stopover":true
},
{
"location":{
"Xa":xx.xxxxxxxxxxxxx,
"Ya":xx.xxxxxxxxxxxxx
},
"stopover":true
}
]