"Usual" functions vs function variables in JavaScript

javascript

Solution

This article might answer your question : JavaScript function declaration ambiguity.

Only the first one is an actual function declaration, whereas the shorthand method is just a regular variable declaration with an anonymous function assigned to it as its value.

(look at the comments, too, which might get some useful informations too)

Problem

Is there any difference between ``` function MyFunc() { // code... } ``` and ``` var MyFunc = function() { // code... }; ``` in JavaScript?

Original source

Related problems