Explore Library
Code QuizAdvanced

Missing await in async function

Spot why this async function logs a Promise instead of the fetched value.

Codejavascript
function getUser() {
  return Promise.resolve({ name: 'Ada' });
}

async function printUser() {
  const user = getUser();
  console.log(user.name);
}

printUser();

What is the bug in this code?