From the third to the fourth video some things changed in index.html. Basically it is the introduction of the POST request. What I do not understand is the flow of the JavaScript in exercise_04_array_button/public/index.html.
We are passing the data-object to the fetch-Post request in line 28. The two variables latand lon were first declared, however not initialized, in line 17. Then they were used to build the data-object in line 20 which is eventually passed into the fetch-function in line 28.
What I do not understand is how these two variables can hold the values of the geolocation. Because the geolocation we are obtaining only below in the lines 35-40. Probably this has to do with how the async and await logic works, but I just wanted to ask because it feels that I missed this piece😅
From the third to the fourth video some things changed in
index.html
. Basically it is the introduction of the POST request. What I do not understand is the flow of the JavaScript inexercise_04_array_button/public/index.html
.We are passing the
data
-object to the fetch-Post request in line 28. The two variableslat
andlon
were first declared, however not initialized, in line 17. Then they were used to build thedata
-object in line 20 which is eventually passed into thefetch
-function in line 28.What I do not understand is how these two variables can hold the values of the geolocation. Because the geolocation we are obtaining only below in the lines 35-40. Probably this has to do with how the
async
andawait
logic works, but I just wanted to ask because it feels that I missed this piece😅Incredible Video Series btw!!!