Skip to content

Instantly share code, notes, and snippets.

@vtno
Created February 5, 2016 03:10
Show Gist options
  • Save vtno/0b8d034d918ba22d47a9 to your computer and use it in GitHub Desktop.
Save vtno/0b8d034d918ba22d47a9 to your computer and use it in GitHub Desktop.
function howVarWorks()
{
//i is also visible here.
for( var i = 0 ; i<10 ;i++)
{
//i is visible everywhere in the function
}
//i is also visible here.
}
function howLetWorks()
{
//j is *not* visible here.
for(let j = 0 ; j<10 j++)
{
//j is only visible here.
}
//j is *not* visible here.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment