async function getValue() {
return 42;
}
const result = getValue();
console.log(typeof result);async function getValue() {
return 42;
}
getValue().then(result => console.log(typeof result));Bug: async functions always return a Promise. Without await or .then(), result is the Promise object — typeof gives "object", not "number".
Explanation: Chaining .then() unwraps the Promise. Now result inside the callback is the actual number 42.
Key Insight: Calling an async function returns a Promise. You must .then() or await it to get the resolved value.