Question · JavaScript and TypeScript course · Module 4: Asynchronous JavaScript

Debugging Asynchronous Code

Which technique is most effective for debugging unhandled errors in a Promise?

Answer options

  • Adding .catch() at the end of the Promise chain or using try/catch with async/await
  • Adding setTimeout() with a large delay
  • Removing all asynchronous operations
  • Using console.log() before every line of code

You can check the correct answer by solving this task in the CodeWorlds game.