JS Built-ins
AsyncPatternsbeginner

async function returns Promise

πŸ“– Usage Example
async function greet() { return 'hello'; }
greet() instanceof Promise; // true

Any async function always returns a Promise, even if you return a plain value.

Async Functions

async function f() { return 42 } declares an async function. Any return value is wrapped in a resolved Promise.

Challenge: Verify that an async function returns a Promise.

πŸ’‘ Hints (2)
  • β€’ All async functions return Promises.
  • β€’ The returned value is automatically wrapped.