Struggling to extract specific data from a JSON file with nested objects like this:
{
"results" : [
{
"address_components" : [
{
"long_name" : "277",
"short_name" : "277",
"types" : [ "street_number" ]
},
{
"long_name" : "Bedford Avenue",
"short_name" : "Bedford Ave",
"types" : [ "route" ]
},
{
"long_name": "Williamsburg",
"short_name": "Williamsburg",
"types": ["neighborhood", "political"]
},
...
],
...
}
],
"status" : "OK"
}
Only interested in the city name. Is there a way to filter and access just that piece of information?
Attempted to retrieve it using:
Object.keys(JSON[0]);