Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Created February 25, 2014 05:39
Show Gist options
  • Save alexmcpherson/9203331 to your computer and use it in GitHub Desktop.
Save alexmcpherson/9203331 to your computer and use it in GitHub Desktop.
Functional scope in javascript
function scopeTest() {
var myVariable = 'Alex'; //var is important, declares it in this scope
console.log(myVariable);
}
scopeTest();
typeof myVariable === "undefined";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment