Created
May 16, 2013 16:55
-
-
Save powerc9000/5593241 to your computer and use it in GitHub Desktop.
Closure
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
function foo(){ | |
var num = 20; | |
return function(){ | |
console.log(num); | |
} | |
} | |
foobar = foo(); | |
foobar(); | |
//Will output 20; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment