I am trying to determine if I understand the function invocation operator properly. If I wanted to immediately run a function, when a page loads I would write the function with parentheses after the function name. This would signal to the function to run it immediately in the current scope.
If I don’t want to run the function immediately, but only after a certain action is done by the user (such as pressing a button), I would remove the parentheses which would tell the function to run only after something is done by the user.
If I want to run a function that has parameters that need to be specified, I would first put this function into an anonymous function, so that the desired function isn’t called immediately.
Is my understanding correct?