Skip to content

Instantly share code, notes, and snippets.

@helabenkhalfallah
Created May 15, 2021 18:09
Show Gist options
  • Save helabenkhalfallah/cf825b9ab1ffbad4c63a39573078c5ba to your computer and use it in GitHub Desktop.
Save helabenkhalfallah/cf825b9ab1ffbad4c63a39573078c5ba to your computer and use it in GitHub Desktop.
JS Function Scole
const run = () => {
// "run" function scope
const two = 2;
let count = 0;
const run2 = () => { }
console.log(two); // 2
console.log(count); // 0
console.log(run2); // function
}
run();
console.log(two); // throws ReferenceError
console.log(count); // throws ReferenceError
console.log(run2); // throws ReferenceError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment