3 ms·
Yep! Or even: const initials = name.match(/\b\w/g).join('')
by padolsey 9y ago
Yep! Or even:
const initials = name.match(/\b\w/g).join('')
- tyingq 9y agoJavaScript's \b in a regex doesn't like unicode. But, yes, this does seem an odd thing to call out to a remote api for. This would need some work to match the features of what was posted, but not much. https://jsfiddle.net/g6nrs5cq/ https://jsfiddle.net/g6nrs5cq/