Created
May 21, 2016 03:12
-
-
Save codeangler/8080f82241a6ebcabd2bcd8e540a9c45 to your computer and use it in GitHub Desktop.
https://repl.it/CT42/2 created by codeangler
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
favouriteColor = "green"; | |
function showColor() { | |
var secondFavouriteColor = "red"; | |
console.log(favouriteColor); | |
console.log(secondFavouriteColor); | |
} | |
showColor(); | |
console.log(favouriteColor); | |
// doesn't display as local scope | |
console.log(secondFavouriteColor); |
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
Native Browser JavaScript | |
>>> green | |
red | |
green | |
ReferenceError: secondFavouriteColor is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment