← Back to archive

Stdle #38 · async · 2026-07-08

What does this JavaScript snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const r = await Promise.allSettled([
Promise.resolve('ok'),
Promise.reject('no'),
]);
console.log(r.map(x => x.status).join(','));
Async
4 attempts left

Answer & explanation