Using vanilla Javascript, I would like to return the city name of multiple location as a String in the nested JSON example below. Using push doesn't work because of the complexity of the JSON structure (I can't change) which result in a separate loop.
"locations":[
{
"location":{
"city":"New place 1",
"other":"random"
}
},
{
"location":{
"city":"New place 2",
"other":"random dom"
}
}
]
Expected output: "New place 1", "New place 2"
Thanks in advance.