Skip to content

QuizNot attempted

Picking a Promise combinator

A dashboard loads 5 independent widgets. If some fail, the rest should still render, and each failure shows an error. Which combinator fits?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Promise.allSettled
  • Promise.allSettled never rejects and gives a { status, value | reason } for every input, so you can render the successes and show an error per failure.
  • Not Promise.all: rejects on the first failure and you lose the other results.
  • Not Promise.race: settles with only the first one to finish.
  • Not Promise.any: resolves with only the first success (good for mirrors and fallback CDNs).