I would like to ask you to help me solve the following question which is giving me trouble: How do I isolate the latitude and longitude variables to display them outside the function
navigator.geolocation.getCurrentPosition(getLatLon);
function getLatLon(position) {
    var latitude = "";
    var longitude = "";
    latitude = position.coords.latitude;
    longitude = position.coords.longitude;
}
document.write("Latitude is "+latitude);
document.write("Longitude is "+longitude);
 
     
    