Skip to content

Instantly share code, notes, and snippets.

@powerc9000
Created May 16, 2013 16:55
Show Gist options
  • Save powerc9000/5593241 to your computer and use it in GitHub Desktop.
Save powerc9000/5593241 to your computer and use it in GitHub Desktop.
Closure
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