Answers for "get the first letter of first name and last name in javascript"

3

js get initials from name

const fullName = nameString.split(' ');
const initials = fullName.shift().charAt(0) + fullName.pop().charAt(0);
return initials.toUpperCase();
Posted by: Guest on May-12-2020
0

get the first letter of first name and last name in javascript

var str = "Java Script Object Notation";
var matches = str.match(/\b(\w)/g); // ['J','S','O','N']
var acronym = matches.join(''); // JSON
Posted by: Guest on July-20-2021

Code answers related to "get the first letter of first name and last name in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language