const API_KEY = 'xxxxxxxxx';
const getData = fetch(`https://quizapi.io/api/v1/questions?apiKey=${ API_KEY }`)
.then(res => res.json())
.then(data => data)
console.log(getData);
Asked
Active
Viewed 45 times
0
-
1Use `.then(console.log)` instead. `.then()` always returns a promise. – Bergi Oct 08 '20 at 09:34
-
1because that's what fetch returns, a Promise – Jaromanda X Oct 08 '20 at 09:34
-
@DBS: the api key is still available in the edit history. It's been leaked and needs to be invalidated, point. – Bergi Oct 08 '20 at 09:38
-
@Bergi Indeed, but I think obscuring it is better than nothing in the mean-time. – DBS Oct 08 '20 at 09:41