hard20 pts · first answer countsnodejsasync-programmingdebugging
return versus return await in try
fail() always rejects. Which statement about a() and b() is true?
async function fail() { throw new Error('boom') }
async function a() {
try { return fail() } catch { return 'caught' }
}
async function b() {
try { return await fail() } catch { return 'caught' }
}Discussion 0
Join free to post in the discussion.
Related questions
- What a 504 from Nginx meansBackend Developer
- Promise and setTimeout orderBackend Developer
- Python default list surpriseBackend Developer
- Checking a key by its valueBackend Developer
- Two awaits that could run togetherBackend Developer
- A 64-bit id changes after parsingBackend Developer
- Webhook signature never matchesBackend Developer
- Async callback inside forEachBackend Developer