In that case, you could customize your lastNameIsValid to something like this, so it allows for blank last names :)
functionlastNameIsValid(lastName){if(!lastName||lastName.length<=10){returntrue;}else{errorMessages.push('Last name cannot be longer than 10 characters');returnfalse;}}
In that case, you could customize your
lastNameIsValid
to something like this, so it allows for blank last names :)Results: