Last active
December 11, 2015 20:29
-
-
Save jackfranklin/4655886 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// what are the key differences between: | |
var foo = function() { | |
alert("Hello World"); | |
}; | |
// and | |
function foo() { | |
alert("Hello World"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
foo is defined at parse time so can be used and var foo is just an alias at run time (i used foo but could be "bar") I dont use it often was just an example of how to get best of both worlds.
Try running: