JS mengekstrak domain dari email

let email = '[email protected]';
let getDomain = email.substring(email.indexOf('@') + 1);

console.log(getDomain); // output - gmail.com
Worried Wasp