const getUserNameFromEmail = (email) => // Arrow function hence the arrow on "=>""
{
return email.slice(0, email.indexOf('@')); // just gets user and truncates rest of email from @ forward
}
console.log(getUserNameFromEmail('[email protected]'));