Last active
August 24, 2017 22:26
-
-
Save tgallacher/74d18b2fe66b3cbc7ea0fe1f4ed79788 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(){ | |
const bar = 5; | |
if(true){ | |
const bar = 100; | |
bar = 20; // TypeError: Assignment to constant variable | |
} | |
console.log(bar); // would have printed: 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment