hard20 pts · first answer countsjavascriptreliability
One failure in Promise.all
You fan out three LLM calls in Node.js. What does this code log?
async function call(id) {
if (id === 2) throw new Error('rate limited')
return id * 10
}
const out = []
try {
const r = await Promise.all([1, 2, 3].map(call))
out.push(...r)
} catch (e) {
out.push(e.message)
}
console.log(out)