Why the answer "Undefined and sushi" and not "grapes and shushi"?

Viewed 13

var favoriteFood = "grapes";

var foodThoughts = function() {
  console.log(`Original favorite food: ${favoriteFood}`);

  var favoriteFood = "sushi";
  console.log(`New favorite food: ${favoriteFood}`);
};
foodThoughts()

Why the answer "Undefined and sushi" and not "grapes and shushi"?

0 Answers
Related