Link Search Menu Expand Document

Global vs. Local Scope in Functions

Summary

  • It is possible to have both local and global variables with the same name.

Final Code

// 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();