Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive Advice Generator App

@mbdelarosa

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello! This is my first time using the fetch() API, any feedback on the JS function implementation would be helpful, thank you!

Community feedback

Nature Son 1,100

@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

1

@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.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord