Global vs Local Scope in Functions (Passed but not solved)

Global vs Local Scope in Functions (Passed but not solved)
0.0 0

#1

Tell us what’s happening:

hi there i have passed the test but there is a warning that i have 2 return’s… hum… i wonder

Your code so far

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

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

myOutfit();

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:


#2

ok i get the point. sorry about that

// Setup
var outerWear = “T-Shirt”;

function myOutfit() {
// Only change code below this line
var outerWear = “sweater”;

// Only change code above this line
return outerWear;
}

myOutfit();