Skip to content

Instantly share code, notes, and snippets.

@paprikka
Created February 13, 2014 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paprikka/8973639 to your computer and use it in GitHub Desktop.
Save paprikka/8973639 to your computer and use it in GitHub Desktop.
"use strict"
var a = 'foo';
function foo() {
console.log(a);
var a = 'bar';
console.log(a);
};
foo();
// LOG:
// undefined
// bar
"use strict"
var a = 'foo';
function foo() {
console.log(a);
let a = 'bar';
console.log(a);
};
foo();
// LOG:
// console.log(a);
// ^
// ReferenceError: a is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment