Course · Section 16: Asynchronous JavaScript: Promises, Async/Await, and AJAX · Lecture 263: Promises and the Fetch API
Implement an async function `safeDivide(a, b)` that returns `a / b`, but if `b` is `0` it throws and catches the error, returning `null`.
+ 1 hidden test run on Submit.
Wrapping the divide in try/catch converts the zero-divisor error into a null result.
Run your code to see results.