Last active
September 25, 2017 19:22
-
-
Save MisaOgura/030603714e36db6fab82851208db9ba3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = 'global' | |
function outer () { | |
var b = 'outer' | |
return function inner () { | |
var c = 'inner' | |
console.log('a:', a) | |
console.log('b:', b) | |
console.log('c:', c) | |
} | |
} | |
var innerFunc = outer() | |
a = 'GLOBAL' | |
innerFunc() | |
// a: GLOBAL | |
// b: outer | |
// c: inner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment