Johnson & Johnson Interview Question

How do you validate emails in front-end development?