How to convert a full name to an acronym with the initials
•
1 min read
So, your name is John Doe and want to get JD in javascript?
const shortNames = n => {
return n.split(' ').map(d => d.substr(0, 1).toUpperCase()).join('')
}
shortNames('John Doe') // JD