Skip to content

Instantly share code, notes, and snippets.

@pope
Created December 16, 2009 20:50
Show Gist options
  • Save pope/258153 to your computer and use it in GitHub Desktop.
Save pope/258153 to your computer and use it in GitHub Desktop.
(function() {
var foo = function() {
bar(); //global at time of parsing
};
var bar = function() {
alert("Hi");
};
})();
(function() {
function foo() {
bar(); //knows about bar in closure at time of parsing
};
function bar() {
alert("Hi");
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment