After countless attempts, I still can't figure out what's missing here.
I'm utilizing fetch to retrieve data from Mapbox:
var response = fetch(myURL)
.then(response => response.json())
.then(data => console.log(JSON.stringify(data)))
Despite successfully logging the fetched data in the console, I'm struggling to manipulate it into a usable format. Specifically, I just need the latitude and longitude coordinates, but all my efforts have been fruitless. I've attempted storing the stringified data in an array, crafting functions to assign it to variables, and yet nothing seems to work.
It feels like there's something glaringly obvious that I'm overlooking. Any guidance would be greatly appreciated.
Below is a snippet of what gets printed to the console log:
"type":"FeatureCollection", ... omitted for brevity ... "text":"United States"}]}],"attribution":"NOTICE: © 2022 Mapbox and its suppliers...