Is there a way to extract all of the "-temp" values from the provided JSON data?
{
"weather":{
"notes":{
"cities":[
{
"-id":"scranton",
"-temp":"17"
},
{
"-id":"paris",
"-temp":"16"
},
{
"-id":"new york",
"-temp":"18"
}
]
}
}
}
I attempted to retrieve this information using JavaScript, but unfortunately it returned undefined
data.weather.notes.cities['-temp']
Can anyone suggest how I can effectively retrieve every value of "-temp" from this dataset?