Great for "required fields" such as email addresses!
Our example is very simple as it only checks one field.
Let's expand this example with a more complex function that checks lots of form fields.
Form validation is the process of checking that a form has been filled in correctly before it is processed.
For example, if your form has a box for the user to type their email address, you might want your form handler to check that they've filled in their address before you deal with the rest of the form.