Created
April 30, 2014 14:55
-
-
Save nealfennimore/11429371 to your computer and use it in GitHub Desktop.
More than one variable Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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