Global vs. Local Scope in Functions

Tell us what’s happening:

Your code so far

// Setup
var outerWear = "T-Shirt";

function myOutfit() {
  // Only change code below this line
  var myOutfit = "sweater";
  // Only change code above this line
  return outerWear;


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.54.

Link to the challenge:

I can see the confusion here. Let’s try to clear that up:

  1. myOutfit is not the variable name you want.
  2. var creates a new variable. The challenge wants to you overwrite the variable that already exists.
1 Like

Always read exercise descriptions and requirements with a clear mindset.

Check your variable names.