[Solved] Is there a way to return true if the user allows location sharing and false if denied? [closed]

[ad_1]

    navigator.permissions.query({name: 'geolocation'}).then(function(status) {
      console.log(status);
    });

[ad_2]

solved Is there a way to return true if the user allows location sharing and false if denied? [closed]