+ 1
What's wrong in this code?
5 Answers
0
The error says that the getCurrentPostion() method is missing a parameter. That meets takes a function as a parameter. Please read about it here
https://www.w3schools.com/htmL/html5_geolocation.asp
0
The function which is the parameter of the getCurrentPostion () method will receive an object as a parameter, which will contain the coordinates
0
So you shall have to make a function something like this
```
let lat, lon;
function showPostion(position){
lat = position.coords.latitude;
lon = position.coords.longitude;
}
```
Then you can use the lat and lon variables for your purpose.
0
what about my code I want to write my code as a promise
0
help me in that way