Interview Hub
Sign in

Q8: How do you avoid unhandled Promise rejections?

MidAsync 29

Answer

Always attach .catch() or use try/catch with await. For Promise.all, one rejection rejects the whole batch — use allSettled when you need every outcome. In Node, unhandled rejections can crash the process depending on flags/version; treat them as bugs.

Having a tech or coding interview? Check 29 JavaScript & Node.js interview questions.

EditorJavaScript · local only