JavaScript Window navigator.geolocation
JavaScript Window navigator.geolocation
The geolocation property is used to return a Geolocation object which is used to locate the user position. It is a read-only property and is available only in secure contexts (HTTPS). We can only use this property if the user approves it otherwise we can not use it. This property works more accurately with devices having GPS in them.
Syntax:-
Its syntax is:- navigator.geolocation
Return:-
Its return is:- a geolocation object of your current position