1functionwhatDoYouDo(name,job){2// code goes here
3}
Function Expression
1letwhatDoYouDo=function(name,job){2// code goes here
3}
A Function Expression defines a function as a part of a larger expression syntax (typically a variable assignment )
Differences
Function declaration/statements always have a function name whereas in function expressions the function is usually without a name i.e. anonymous. (named functions are easier to debug)
Function declaration are hoisted to the top of the enclosing function or global scope (meaning you can use the function before you declared it). Function expression are NOT hoised.