@NatureSon22
Posted
When using fetch, it's important to include a catch block as well. The catch block is responsible for capturing any potential errors that might arise during the program's execution, preventing the entire program from stopping unexpectedly. What can we include within the catch block? You have the option to show the user an element describing the issue, or you can display a simple prompt indicating that an error has occurred. This approach is user-friendly and straightforward.
Marked as helpful
@mbdelarosa
Posted
@NatureSon22 Thank you for the comment! Have updated my solution with a try-catch, will keep this in mind for future challenges as well.