Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nealfennimore/11429371 to your computer and use it in GitHub Desktop.
Save nealfennimore/11429371 to your computer and use it in GitHub Desktop.
More than one variable Javascript
// More than one variable - this is called shadowing
var city = "Chicago";
function nyc() {
var city = "NYC";
console.log(city); // SHould print "NYC"
}
nyc();
console.log(city); // Should print "Chicago"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment