Skip to content

Instantly share code, notes, and snippets.

@marcins
Created July 1, 2011 05:45
Show Gist options
  • Save marcins/1057937 to your computer and use it in GitHub Desktop.
Save marcins/1057937 to your computer and use it in GitHub Desktop.
Passing closure vs function test
function wrap()
{
var a = 5;
var testClosure = function testClosure()
{
console.log(a);
}
func(function() { console.log(a) });
func(testClosure);
}
function func(closure)
{
closure();
}
wrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment