Johnson & Johnson interview question

How do you validate emails in front-end development?