There are several ways to write anonymous function
Declare Function as an Object first then execute it.
Use parentheses to force a declared function to be executed since JavaScript evaluates expressions from the inner parentheses to outer parentheses
We can use "void" to evaluate a lone operand without using parentheses as the wrapper. of function
Technically these three patterns are equivalent, but I do prefer the pattern 3 for my own reasons.
You may review these patterns and see which make sense most for you.