Skip to content

Instantly share code, notes, and snippets.

@jasonbellamy
Created May 21, 2015 15:12
Show Gist options
  • Save jasonbellamy/aa34c48c44ce2f07830c to your computer and use it in GitHub Desktop.
Save jasonbellamy/aa34c48c44ce2f07830c to your computer and use it in GitHub Desktop.
Named function expressions
/**
* 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