← Back to archive

Stdle #28 · async · 2026-06-28

What does this JavaScript snippet output?

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

try {
await Promise.reject(new Error('fail'));
} catch (e) {
console.log(e.message);
}
console.log('after');
Async
2 lines
4 attempts left

Answer & explanation