Skip to content

Instantly share code, notes, and snippets.

@rayinla
Created December 9, 2017 13:36
Show Gist options
  • Save rayinla/2e194e00966e6380001d65fbaff56580 to your computer and use it in GitHub Desktop.
Save rayinla/2e194e00966e6380001d65fbaff56580 to your computer and use it in GitHub Desktop.
function firstFunc(){
var firstVar = 2;
firstVar += secondVar; // secondVar is undefined because scope doesn’t look down
function secondFunc(){
var secondVar = 5;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment