Skip to content

Instantly share code, notes, and snippets.

@kselax
Created November 14, 2018 23:07
Show Gist options
  • Select an option

  • Save kselax/3c57d357fe935e5dd202201efbb64925 to your computer and use it in GitHub Desktop.

Select an option

Save kselax/3c57d357fe935e5dd202201efbb64925 to your computer and use it in GitHub Desktop.
let scope variable can't be break by var
{
let x = 1
{
var x = 2 // SyntaxError: Identifier 'x' has already been declared
{
console.log('scope1 x = ', x);
}
console.log('scope2 x = ', x);
}
console.log('scope3 x = ', x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment