JavaScript · Junior · Question 34 of 75
What does an async function return?
- ✓Correct answer: Always a promise, even with
return 42inside - 2The
returnvalue directly, without a promise - 3
undefined, with the result passed to a callback
Explanation
async function f() { return 42 } returns Promise<42>. An exception inside becomes a rejected promise. That's why the result is obtained with await or .then().