Extract Domain from Email

let email = ‘john.doe@gmail.com’;
let domain = email.substring(email.indexOf(‘@’) + 1);

console.log(domain)

Leave a comment

Your email address will not be published. Required fields are marked *