The first is a function declaration which is a statement. The second is a function expression. Only the value that an expression produces can be executed.
– VLAZSep 15 '20 at 06:53
Also relevant: [How does the (function() {})() construct work and why do people use it?](https://stackoverflow.com/q/1639180) | [var functionName = function() {} vs function functionName() {}](https://stackoverflow.com/q/336859)
– VLAZSep 15 '20 at 06:54