r/code • • Mar 11 '24

Javascript question about fetch

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

3 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/OsamuMidoriya Mar 14 '24

he says why he use if but not why if and try are both used