Difference between function declaration and function expression
Function declarations are hoisted to the top of the code by the browser before any code is executed. Specifically, all of the functions written with function declarations are “known” before any code is run. This allows you to call a function before you declare.
Function expressions, however, do not hoist. If you try to run a function before you’ve expressed it, you’ll get an error.
References
Categories :
JavaScript