2 Answers
2

They are basically the same thing, but in the second example you additionally assign the function to a variable. This way of creating a function is very useful when overriding an existing function of some object, let's say:

There is a very important difference: In the first example the function is available at the beginning of the execution context, in the second not until the assignment statement has been executed.
–
zeroflagLMar 17 '13 at 15:54