I am using javascript and this API. When I console log it with json it has two dropdowns. [[PromiseStatus]] and [[PromiseValue]]. I need to access Promise Value to access the articles. Any help would be much appreciated. Here is my code:
fetch(“https://google-news.p.rapidapi.com/v1/topic_headlines?country=US&lang=en&topic=NATION”, {
“method”: “GET”,
“headers”: {
“x-rapidapi-host”: “google-news.p.rapidapi.com”,
“x-rapidapi-key”: “MYKEY”
}
})
.then(response => {
let data = response.json();
console.log(data)
console.log(data.promise.promisevalue);
})
.catch(err => {
console.log(err);
});
Присоединяйтесь к обсуждению – добавьте комментарий ниже: