allSettled when one failure should not sink the rest
Promise.all rejects on the first failure and the other results are lost, even the ones that succeeded. For a fan-out where partial results are useful, allSettled returns every outcome.
const results = await Promise.allSettled(urls.map(fetchJson));
const ok = results.flatMap((r) => (r.status === "fulfilled" ? [r.value] : []));Use all when the results are only meaningful together. Use allSettled when you would rather have nine out of ten.
javascript