I'm trying to return the value of the term "value"
within the array "distance"
from the following JSON code:
{
"destination_addresses" : [ "San Francisco, CA, USA", "Victoria, BC, Canada" ],
"origin_addresses" : [ "Vancouver, BC, Canada", "Seattle, WA, USA" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "1,529 km",
"value" : 1528699
},
"duration" : {
"text" : "14 hours 56 mins",
"value" : 53778
},
"status" : "OK"
}
}
To do this, I've tried using the code rows.elements.distance.value
to select it, but this does not return a value. Why am I having this problem?