A single javascript function to check whether a provided email is in a valid form.
import isValidEmail from './isValidEmail';
const email = "[email protected]";
console.log(isValidEmail(email));
>true
~$
import isValidEmail from './isValidEmail';
const invalid_email = "[email protected]";
console.log(isValidEmail(invalid_email));
>false
~$