← All topics
Quiz: Error Handling and Debugging: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. What does this print? (code)
- Q3. What does this print? (code)
- Q4. Which error type do you get from undefined.length?
- Q5. Why throw new Error("…") instead of throw "failed"?
- Q6. In a catch block, you get an error your code does not know how to handle. What should you do?
- Q7. placeOrder() calls chargeCard(), which throws. Only main() has a try/catch around placeOrder(). What happens?
- Q8. Which is the correct way to catch a rejected promise in an async function?
- Q9. Which DevTools feature pauses your code on a chosen line so you can inspect variables?
- Q10. What is finally best used for?