Skip to content

Instantly share code, notes, and snippets.

@paschalidi
Created December 13, 2019 11:15
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 paschalidi/61d5065b15b33e741fdec3b22c68faff to your computer and use it in GitHub Desktop.
Save paschalidi/61d5065b15b33e741fdec3b22c68faff to your computer and use it in GitHub Desktop.
function foo() {
// All variables are accessible within functions.
var bar = 'bar';
let baz = 'baz';
const qux = 'qux';
console.log(bar);
console.log(baz);
console.log(qux);
}
console.log(bar);
console.log(baz);
console.log(qux);
if (true) {
var bar = 'bar';
let baz = 'baz';
const qux = 'qux';
}
console.log(bar);
console.log(baz);
console.log(qux);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment