Created
August 16, 2018 10:41
-
-
Save CodHeK/bebdc076c762c104422742cbd502f6d9 to your computer and use it in GitHub Desktop.
diff let, var
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
if(true) { | |
v = 9; | |
} | |
var v; | |
console.log(v) //prints 9 | |
if(true) { | |
v = 9; | |
} | |
let v; | |
console.log(v) //error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment