Course · Section 16: Asynchronous JavaScript: Promises, Async/Await, and AJAX · Lecture 275: Error Handling With try...catch
Implement an async function `fetchSafe(shouldFail, value, fallback)` that throws when `shouldFail` is true, catches it, and returns `fallback`; otherwise returns `value`.
+ 1 hidden test run on Submit.
try/catch inside an async function converts a failure into a returned fallback value.
Run your code to see results.