Explore Library
Code QuizAdvanced

Promise Missing Return Value

Spot the bug where a Promise chain forgets to return the parsed data.

Codejavascript
function getUser() {
  return fetch('/api/user')
    .then(response => {
      response.json();
    });
}

getUser().then(user => {
  console.log(user.name);
});

What is the bug in this code?