Last active
August 24, 2017 22:26
-
-
Save tgallacher/5025a6859163ed296d98a598448539d2 to your computer and use it in GitHub Desktop.
Supplementary code snippet for Medium post
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
function foo(){ | |
var bar = 5; | |
if(true){ | |
var bar = 100; // Even though var isn't block scoped, this doesn't throw an error! | |
} | |
console.log(bar); // prints: 100 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment