AI

Things don't always go according to plan. In async code, we use try/catch to handle errors elegantly.

Your Task:

  • Create an async function safeCall
  • Inside a try block, await the riskyOperation function
  • If it succeeds, return the result
  • Inside a catch block, return the string "Recovered from error"
TypeScript Solution
Loading...

Submit your code to see test results