Code QuizAdvanced

Awaited Unwraps the Promise

See how Awaited is needed to strip the Promise wrapper from an async return type.

Codetypescript
async function fetchData(): Promise<string> {
  return "data";
}

// Expected Data to be string
type Data = ReturnType<typeof fetchData>;

What is the bug in this code?