Welcome to the Treehouse Community
Looking to learn something new?
I just finished the jQuery basic lesson for the form passwords and noticed when some functions were called it used a bracket at the end and other times it did not.
e.g. isPasswordValid() <--bracket $password.focus(passwordEvent) <-- no bracket
Why is this? When should you use each?
Aaron Loften8,303 Points
Thats a weird but valid way to write some functions. Conditional statements can be written that way too. I know, it irks me as well. It use to be my old boss' preferred way of doing it.
So using brackets calls a function right away, but without means at some point in future reference this function?