Console.log returns “T-shirt” shouldn’t it return “sweater” since the local version of the variable is present.
Your code so far
// Setup
const outerWear = "T-Shirt";
function myOutfit() {
// Only change code below this line
let outerWear = "sweater";
// Only change code above this line
return outerWear;
}
myOutfit();
console.log(outerWear)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Global vs. Local Scope in Functions
Link to the challenge: