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.
Its syntax is:- navigator.geolocation
Its return is:- a geolocation object of your current position