I am using a public api for fetch data. It is returning promise.
I want to access the result of the prmise means data or info which its returning.
My code is :
const getWeather=async ()=>{
const data=await fetch(`https://api.openweathermap.org/data/2.5/weather?q=London&appid=3128c60d19195ca88d4f09de900eacd2`)
const res= data.json();
console.log(res)
}
But in return I am getting as:
[[Prototype]]
:
Promise
[[PromiseState]]
:
"fulfilled"
[[PromiseResult]]
:
Object
base
:
"stations"
clouds
:
{all: 75}
cod
:
200
coord
:
{lon: -0.1257, lat: 51.5085}
dt
:
1716389805
id
:
2643743
main
:
{temp: 287.95, feels_like: 287.84, temp_min: 287.16, temp_max: 288.85, pressure: 1006, …}
name
:
"London"
rain
:
{1h: 2.04}
[[Prototype]]
:
Object
How to access the [[PromiseResult]]?
3