MediumEvent Loop & Promises💻 Output Question

async function always returns a Promise

💡

Hint

async functions always return a Promise wrapping their return value.

What does this output?

async function getValue() { return 42; }
const result = getValue();
console.log(result instanceof Promise);
result.then(v => console.log(v));

Correct Output

true
42

Why this output?

Explanation: async functions always return a Promise. result is a Promise, not 42. .then unwraps the value.

Key Insight: async functions always return a Promise wrapping their return value.

More Event Loop & Promises Output Questions

EasySynchronous code runs before setTimeoutMediumPromise microtask before setTimeout macrotaskMediumPromise chain passes valuesHardTwo Promise chains interleave in microtask queue

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz