JS Built-ins
AsyncPatternsbeginner

async function returns Promise

πŸ“– Usage Example
async function double(n) { return n * 2; }
double(5) instanceof Promise; // true

async functions always return a Promise, even when they return primitives.

Async Functions

async function f() { return 1 } declares an async function. Calling it returns a Promise.

Challenge: Verify that calling an async function returns a Promise.

πŸ’‘ Hints (2)
  • β€’ Async functions always return Promises.
  • β€’ The return value is wrapped in a resolved Promise.