How to extract the user name from an email address in Node.js

1 Answer

0 votes
const email = 'thename@email.com';

const uname = email.split('@')[0];

console.log(uname);

  
  
  
  
/*
run:

thename
  
*/

 



answered Apr 29, 2022 by avibootz

Related questions

1 answer 160 views
1 answer 152 views
1 answer 192 views
2 answers 359 views
1 answer 151 views
1 answer 172 views
1 answer 157 views
...