I have 6 email address like below:
(1) [email protected] -> valid
(2) @hotmail.com -> invalid
(3) [email protected], [email protected] -> valid
(4) [email protected], @hotmail.com -> invalid
(5) [email protected], [email protected], [email protected] -> valid
(6) [email protected], @hotmail.com, [email protected] -> invalid
How do I use JavaScript to determine that the email address is in full format?
I try startsWith("@hotmail.com")
, endsWith("hotmail.com")
, indexOf("@hotmail.com")
also cannot fulfill all the email addresses above.
Can someone help me?