Created
July 31, 2017 02:56
-
-
Save thebopshoobop/50f3fac8e3e6720e5619c36b54fd06a1 to your computer and use it in GitHub Desktop.
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
var baz = 'yes'; | |
if (true) { | |
var baz = 'no'; | |
} | |
console.log(baz); // 'no' | |
let bar = 'yes'; | |
if (true) { | |
let baz = 'no'; | |
} | |
console.log(baz); // 'yes' | |
let foo = 'yes'; | |
let foo = 'no'; // SyntaxError: 'foo' has already been declared | |
for (var i = 0; i < 4; i++) { | |
baz[i] = True; | |
} | |
console.log(i); // 4 | |
for (let j = 0; j < 4; j++) { | |
baz[j] = False; | |
} | |
console.log(j); // ReferenceError: j is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment