How to validate email in JavaScript

Regex
By Jad Joubran · 
Last updated Dec 16, 2017
const pattern = /\S+@\S+\.\S+/;

pattern.test("[email protected]");
true