If you only wish to have a function avaliable by specific name, the minimum way is to write without assignment. Just because you don't need to perform an extra action and write extra code, you just need to have a function you can call.
A way with assignment you've written is an example of using an anonymous function, and it's not practically the case that needs an anonymous function. One example use of this feature is that you can pass actions to certain functions as arguments. Take a look at this page of jQuery docs on hide
. This function accepts two arguments: the length of animation and the action to do after it's complete. You may not need that action anywhere else, so why make another identifier and clutter your namespace? There might be reasons, but these are beyond the scope of this question.
JS syntax allows both, but it's a side effect of having anonymous functions avaliable in JS.
So it's a matter of choice and habits.