@Ikuewumi
Posted
Hi 👋 @Wannika123, Great project, really well done
About your question, the try...catch...finally
block was the first one made, it is just another tool for control flow, like an if
, or switch
statement.
The fetch().then().catch().finally()
was a way to bring the try...catch
functionality into fetch
calls
So, they do the same thing, provide functions for code to run if it fails, preventing the error from spilling out into the outer scope
Happy Coding, Ayobami
Marked as helpful
@Wannika123
Posted
@Ikuewumi Thanks!