Validates if the domain of an email matches the target domain.
The email address to validate.
The domain to check against.
True if the email's domain matches the target domain, false otherwise.
validateDomain("user@example.com", "example.com"); // truevalidateDomain("admin@other.com", "example.com"); // false Copy
validateDomain("user@example.com", "example.com"); // truevalidateDomain("admin@other.com", "example.com"); // false
Validates if the domain of an email matches the target domain.