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:

Your Browser User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0.

Link to the challenge:

Variable within the function needs to have same name as the one outside the function
so var myOutfit="sweater"; to var outerWear="sweater";

1 Like