An example of a JS Named Function is:
The name of this function is highFive.
You can see in this image the name of this function highlighted:
There is no name for this function.
This is why it is called an anonymous function - because it has no name.
Let's work through the thinking behind these four (of many) reasons.
"1 - We need a function that is used only once"
You may sometimes write functions that are used only once.
Rather than having to create a new name for the function, you can just write an Anonymous Function.
Because this function is used in the addition that is going to be evaluated, you will only use it once.
That way you don't have to keep coming up with new function names.
"2 - We need a function that is immediately invoked"
You may sometimes write a function that needs to be immediately invoked as soon as it's defined.
You can see that there are parentheses that enclose the anonymous function.
What makes the anonymous function evaluate is the open / close parentheses after the enclosing parentheses.
This helps you to isolate different variable declarations.
"3 - We need a function that is being passed into another function"
"4 - We need a function that is being returned from another function"