function solution(address) { return address.substring(address.lastIndexOf('@') + 1); }
var myemail = 'test@yahoo.com' if (/@yahoo.coms*$/.test(myemail)) { console.log("it ends in @yahoo"); }