- Joined
- Aug 12, 2023
- Messages
- 1
- Reaction score
- 0
I am learning JS and have found (with enough searching) decent examples for everything else I have done. I am stuck on updating a JSON object with multiple objects. I generated it from Google Sheet and successfully read it in and found these:
Which gives me this.....
So if I want to update Latitude and Longitude say under Flagstaff how would I do that? I have
from Google GeoCoder so location is a LatLng object.
Thanks
Jim
Thanks
JavaScript:
fetch('./carshows.json') // Returns a Promise so call the Promise's function "then"
.then((response) => { // response is the object returned from fetch, so pass it into our anonymous function for the succeded callback (Then parameter) as an input parameter
return response.json(); // passed in the repsonse as a parameter so use it to Convert it to JSON and return the Promise object it created
})
.then((data) => { // data is the return from the previous "then" anonymous function which resolves into a JavaScript Object
console.log(data)
console.log(Object.keys(data))
console.log(Object.values(data))
console.log(Object.entries(data))
Which gives me this.....
So if I want to update Latitude and Longitude say under Flagstaff how would I do that? I have
JavaScript:
results[i].geometry.location
from Google GeoCoder so location is a LatLng object.
Thanks
Jim
Thanks