Facebook Pixel
Promise Interview Questions in JavaScript

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

The answer

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.

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?

Your learning library

Small steps. Big possibilities.

Find your next course. Build something great.

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

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.