loginForm.validator
just checks for the existence of the object (continue if it exists) and
loginForm.validator.validate()
calls the validate () function of the object (and if the function also returns true, then the commands inside the if statement will be executed).
source
to share