← BYTES
JavaScript·Intermediate·Ref: 3.2.17

What does calling an `async` function actually return, even if the function body never explicitly returns a Promise?

Have a question about this video? Mention reference 3.2.17 when you contact us.

a.undefined, unless an explicit Promise is returned
b.The literal value computed inside the function, synchronously
c.A Promise, which resolves with whatever value the function body returns (or rejects if it throws)
d.A plain object with a .then() method added manually by the engine
Every `async function` implicitly wraps its return value in a Promise -- calling `const p = myAsyncFn();` always gives you a Promise object immediately, regardless of what the function internally does or awaits, which is why you still need `.then()` or `await` to get the actual resolved value out.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES3217#JavaScript