Why does my get function returns undefined?

Here is my code:

public device_location: any = {};

constructor(private geolocation: Geolocation) {
this.setGeolocation();
this.getGeolocation();
}
  
setGeolocation(){
   this.geolocation.getCurrentPosition().then((resp) => {
       // resp.coords.latitude
       this.device_location.latitude = resp.coords.latitude;
       this.device_location.longitude = resp.coords.longitude;
       console.log( this.device_location.longitude);
       }).catch((error) => {
   console.log('Error getting location', error);
 });
 
 let watch = this.geolocation.watchPosition();
 watch.subscribe((data) => {
// data can be a set of coordinates, or an error (if an error occurred).
// data.coords.latitude
// data.coords.longitude
 });
}

getGeolocation(){
    console.log( JSON.stringify(this.device_location) );
    return this.device_location;
}

and here is the output:

123.45600
{}

because “getCurrentPosition()” return a promise.
so, “getGeolocation” may run before “getCurrentPosition”.