Node.js · Junior · Question 39 of 75
What happens if a promise rejects and nothing handles the rejection?
- 1The error is silently ignored
- ✓Correct answer: Node.js emits
unhandledRejectionand by default crashes the process - 3Node.js retries the operation automatically
Explanation
Since Node.js 15, unhandled rejections throw by default. Always await promises inside try/catch or add .catch().