Intro-to-Data-APIs-JS | Working with Data and APIs in JavaScript | REST library
kandi X-RAY | Intro-to-Data-APIs-JS Summary
kandi X-RAY | Intro-to-Data-APIs-JS Summary
Working with Data and APIs in JavaScript
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Intro-to-Data-APIs-JS
Intro-to-Data-APIs-JS Key Features
Intro-to-Data-APIs-JS Examples and Code Snippets
Community Discussions
Trending Discussions on Intro-to-Data-APIs-JS
QUESTION
There is this piece of javascript-code (which comes from the amazing CodingTrain series!!):
My Question is the following:
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 already up there in the code. 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 am not sure.
...ANSWER
Answered 2021-Aug-06 at 19:44Doesn't their tutorial explain about variables and variable scoping?
Basically when you have code like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Intro-to-Data-APIs-JS
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page