try/catch
Also written: try, catch
JavaScript syntax that runs the code in `try` and, if it throws an error, runs the `catch` block to handle it. It lets a failed fetch show an error message instead of breaking the page.
Also written: try, catch
JavaScript syntax that runs the code in `try` and, if it throws an error, runs the `catch` block to handle it. It lets a failed fetch show an error message instead of breaking the page.