function foo() { ... }
Because of function hoisting, the function declared this way can be called both after and before the definition.
Function Expression
- Named Function Expression
var foo = function bar() { ... }
- Anonymous Function Expression
var foo = function() { ... }
foo()
can be called only after creation.
No comments:
Post a Comment