Guest User

Untitled

a guest
Feb 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. const getInitials = (text) => {
  2. const words = text.split(" ", 2);
  3. const initials = [
  4. (words[0][0]).toUpperCase(),
  5. (words[1][0] || "").toUpperCase()
  6. ].join("")
  7. return initials
  8. }
Add Comment
Please, Sign In to add comment