Facebook Pixel

What happens if a .then callback throws an error in JavaScript?

The error propagates to the next .catch in the chain. Subsequent .then callbacks are skipped. If there is no .catch, it becomes an unhandled rejection.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Promise Interview Questions in JavaScript

1, 3, 2. The .then callback is a microtask; it runs after the synchronous code (1 and 3) completes and the call stack is empty.

No. .catch only runs when the promise rejects or a .then above it throws. If the promise is fulfilled, .catch is skipped and the next .then receives the value.

Promise.all rejects if any promise rejects (fast fail). Promise.allSettled waits for all promises, even if some reject, and returns an array of { status, value/reason } objects.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.