Why is geolocation.getCurrentPosition() returning immediately? [duplicate]

As far as I know it’s not an async function, and yet I have a case where I call the function and the control flow goes directly to the return statement of my function:

function getGeoLocation(): GeolocationPosition | null
{

  const position_options: PositionOptions = {};
  position_options.enableHighAccuracy = true;
  
  
  let gps_position = null;


  if (navigator.geolocation)
    { // GET THE GPS COORDS
      navigator.geolocation.getCurrentPosition(function(pos: GeolocationPosition)
      {// SUCCESS
        console.log('success, got geolocation');
        gps_position = pos;
      }, 
      function(pos_error: GeolocationPositionError) 
      {// FAILURE
        console.log('failed to get geolocation');

        gps_position = null;

      }, position_options); 
      
    }
    
    
    
    
    return gps_position;


    
}

I expected the function to get to the return statement after the getCurrentPosition function returns but instead what’s happening is it’s calling it and then immediately jumping to the return statement, which invariably returns null because that’s what I set it as at the start. It doesn’t appear to be an async function from the looks of it:

https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition