There is no difference superficially, so you can use both formats in your code.
To js interpreter it is different though.
First one is a named funciton.
Second one is an anonymous function that gets assigned to a variable.
Also, while debugging, you won't get a name of for the second function in stack trace.