Skip to content

Instantly share code, notes, and snippets.

@colintoh
Last active August 29, 2015 14:07
Show Gist options
  • Save colintoh/6673049706e8ffb8e71d to your computer and use it in GitHub Desktop.
Save colintoh/6673049706e8ffb8e71d to your computer and use it in GitHub Desktop.
Block Scope with `let` keyword
var name = "Colin";
let nameBlock = "John";
if(true){
var name = "Max";
let nameBlock = "Min";
console.log(name); //Max
console.log(nameBlock); //Min
}
console.log(name); // Max
console.log(nameBlock); // John
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment