Button.prototype.onRelease = function(event)
{
// //
async function h()
{
const response=await fetch('https://api.weatherapi.com/v1/current.json?key=dcaa49a218e94bd7a2173630200712&q=pakistan',{method:'GET'});
const users=await response.json();
return users;
}
var a=h();
a.then((data)=>console.log(data.location)).catch(err =>console.log(err));
------Error occurr from here-------
selfclass.Country.element.text=""+a.location.country;
selfclass.capital.element.text=""+a.location.name;
selfclass.localtime.element.text=""+a.location.localtime;
selfclass.longitude.element.text=""+a.location.lon;
selfclass.latitude.element.text=""+a.location.lat;
};