MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/code/comments/1bc9zwc/question_about_fetch/kuv2yvp/?context=3
r/code • u/OsamuMidoriya • Mar 11 '24
In the example we are fetching Pokémon from the pokeAPI
why does he add a if statement if he already has a catch and why do we use await here
if
await
7 comments sorted by
View all comments
Show parent comment
1
I rewatch the video and i made a mistake, I look at the screen shoot to write my question. I didn't want to know about await, i wanted to know why .then is used with fetch not in { }. i know .then does something after a function is called
.then
fetch
View all comments
Show parent comment
1
u/OsamuMidoriya Mar 14 '24
I rewatch the video and i made a mistake, I look at the screen shoot to write my question. I didn't want to know about await, i wanted to know why
.thenis used withfetchnot in { }. i know.thendoes something after a function is called