LOGBOOK

HELP

Quiz Entry - updated: 2026.07.05

What does the async keyword do when placed before a function?

The async keyword marks a function as asynchronous, so it always returns a Promise and can use await inside.

The function can use await inside to pause execution until a Promise resolves. Even if you return a plain value, it gets wrapped in a resolved Promise automatically.

async function getData() {
  // Returns Promise.resolve("hello")
  return "hello";
}

Go deeper:

  • doc MDN: async function — why the return value is always wrapped in a Promise and how await works inside.

From Quiz: WEBT / Backend Integration | Updated: Jul 05, 2026