A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-38.js
1constr=awaitPromise.allSettled([
2Promise.resolve('ok'),
3Promise.reject('no'),
4]);
5console.log(r.map(x=>x.status).join(','));
Async
Answer & explanation
Console output
fulfilled,rejected
Why
Unlike Promise.all, Promise.allSettled waits for every promise to settle and never rejects. It resolves to an array of objects, each having a status of either "fulfilled" (with value) or "rejected" (with reason), preserving input order. Mapping the statuses gives "fulfilled,rejected".