Created
May 21, 2015 15:12
-
-
Save jasonbellamy/aa34c48c44ce2f07830c to your computer and use it in GitHub Desktop.
Named function expressions
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
/** | |
* When working with Named function expressions which one of the following is preffered and why? | |
*/ | |
/* Use the same name for the function and the variable its assigned to.*/ | |
var foo = function foo() { | |
return foo; | |
} | |
/* Use a different name for the function and the variable its assigned to. */ | |
var foo = function bar() { | |
return bar; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment