Closed davidchase closed 10 years ago
Function expression is an anon function, named func expr is a named function and func declaration is the var foo form
@bevacqua That is definitely not right. The "var foo form" is a function expression.
Should be more accurate after 6dfed021a3dfa21ddc76510aef0ab8624ca51ca9
:thumbsup: for the fix, but i still prefer function expressions var foo = function(){}
like you say always declare function on top of scope, that way your using them only after they have been created :smile:
Yeah, that's fine too, but using declarations you won't have to remember to put them before things that need to execute the function
Yet underneath you show that
var foo = function(){};
is bad whilefoo function(){};
is goodI thought
function expression
is the storing of anonymous or named functions in a variable andfunction declaration
is a named function without a variable assignment.