0

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"?

evolutionxbox
  • 3,932
  • 6
  • 34
  • 51

0 Answers0