Hacker News new | past | comments | ask | show | jobs | submit login

Yep! Or even:

    const initials = name.match(/\b\w/g).join('')



JavaScript'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/




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: